Correlation between two dose-response R curves?

Asked

Viewed 79 times

3

I would like to know how to correlate two dose response curves of the "drc"?

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 equal or different. And to plot this correlation leave something more visual, is it right to plot like this? In this example the curve of model 2 is practically all within the confidence interval of the other curve, this means 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) 

1 answer

4


I don’t 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 class objects 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 "objective is to know if the curves are statistically equal or different" one can also 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 a p-value equal to 0.44 the null hypothesis is not rejected.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.