Correlation between two dose-response curves R?

3

Would you like to know how to correlate the two dose response curves of the "drc" package?

Example:

ryegrass.m1 <- drm(rootl~conc, data = ryegrass, fct = LL.4())
ryegrass.m2 <- drm(rootl~conc, data = ryegrass, fct = LL.3())
cor (ryegrass.m1, ryegrass.m2) #Não funciona

My goal is to know if the curves are statistically the same or different. And to plot this correlation leave something more visual, is it okay to plot like this? In this example, the curve of model 2 is practically all within the confidence interval of the other curve, does it mean that they are statistically equal?

plot(ryegrass.m1, broken = TRUE)
plot(ryegrass.m2, broken = TRUE, add = TRUE, type = "none", col = 2, lty = 2)  
plot(ryegrass.m1, broken = TRUE, type="confidence", add=TRUE) 
    
asked by anonymous 20.02.2018 / 01:51

1 answer

3

I do not know if this is what you want, but "the correlation between two curves" can be given with the following code. First we get the points of the curves with predict (actually the method for objects of class drc , predict.drc .) Then we calculate the correlation.

pred.m1 <- predict(ryegrass.m1)
pred.m2 <- predict(ryegrass.m2)
cor(pred.m1, pred.m2)
#[1] 0.9986341
If the "goal is to know if the curves are statistically the same or different" one can still make a Kolmogorov-Smirnov test .

ks.test(pred.m1, pred.m2)
#        Two-sample Kolmogorov-Smirnov test
#
#data:  pred.m1 and pred.m2
#D = 0.25, p-value = 0.4413
#alternative hypothesis: two-sided
#
#Warning message:
#In ks.test(pred.m1, pred.m2, exact = FALSE) :
#  p-value will be approximate in the presence of ties

With p-value equal to 0.44 the null hypothesis is not rejected.

    
20.02.2018 / 15:09