一个plot-drc包中的多剂量反应曲线

时间:2017-04-12 23:03:52

标签: r plot

我试图在一个图中绘制三个剂量响应曲线。一旦我将它们绘制在不同的图中,这三个看起来都很好。但是,当我尝试在一个绘图上绘制所有三条曲线时,绘图会显示出来。我希望将所有三种剂量反应曲线叠加到一个图中(马拉硫磷,毒死蜱和moncos(混合物))。

我使用三个.csv文件单独绘制它们。这是我的代码的简化版本。

Chemical    mol average
malathion   0   109.1966667
malathion   0   124.0866667
malathion   0   86.36833333
malathion   0   123.3333333
malathion   0   118.3233333
malathion   0   139.64
malathion   0   122.8033333
malathion   0   127.9833333
malathion   0   118.8433333
malathion   0   130.1333333
malathion   0   127.24
malathion   0   119.51
malathion   0   141.2266667
malathion   0   125.68
malathion   0   123.5366667
malathion   0   122
malathion   0.000330358 133.4433333
malathion   0.000330358 112.4733333
malathion   0.000330358 120.5766667
malathion   0.000330358 102.3633333
malathion   0.000330358 74.67466667
malathion   0.000330358 117.3033333
malathion   0.000330358 105.2426667
malathion   0.000330358 114.63
malathion   0.000991074 57.17633333
malathion   0.000991074 64.67566667
malathion   0.000991074 50.979
malathion   0.000991074 47.312
malathion   0.000991074 54.22833333
malathion   0.000991074 58.531
malathion   0.000991074 45.00266667
malathion   0.000991074 54.13333333
malathion   0.00330358  54.598
malathion   0.00330358  53.67033333
malathion   0.00330358  56.01466667
malathion   0.00330358  55.562
malathion   0.00330358  59.85133333
malathion   0.00330358  61.17333333
malathion   0.00330358  46.64166667
malathion   0.00330358  56.25333333
malathion   0.00991074  66.04766667
malathion   0.00991074  68.837
malathion   0.00991074  64.74533333
malathion   0.00991074  67.00833333
malathion   0.00991074  65.71433333
malathion   0.00991074  69.91666667
malathion   0.00991074  52.67133333
malathion   0.00991074  59.523
malathion   0.0165179   50.43466667
malathion   0.0165179   66.44533333
malathion   0.0165179   47.799
malathion   0.0165179   55.241
malathion   0.0165179   47.363
malathion   0.0165179   32.58
malathion   0.0165179   48.394
malathion   0.0165179   51.04266667
malathion   0.000165179 140.89
malathion   0.000165179 127.57
malathion   0.000165179 119.2633333
malathion   0.000165179 140.9033333
malathion   0.000165179 137.025
malathion   0.000165179 95.405
malathion   0.000165179 105.99
malathion   0.000165179 124.0833333
malathion   0.000660716 132.11
malathion   0.000660716 94.111
malathion   0.000660716 123.33
malathion   0.000660716 121.45
malathion   0.000660716 133.23
malathion   0.000660716 137.6566667
malathion   0.000660716 128.13
malathion   0.000660716 109.88
malathion   0.00991074  92.589
malathion   0.00991074  95.95766667
malathion   0.00991074  87.828
malathion   0.00991074  95.15633333
malathion   0.00991074  61.92833333
malathion   0.00991074  91.07766667
malathion   0.00991074  115.0333333
malathion   0.00991074  106.3866667
malathion   0.0330358   47.32933333
malathion   0.0330358   60.303
malathion   0.0330358   46.05066667
malathion   0.0330358   50.382
malathion   0.0330358   72.069
malathion   0.0330358   72.218
malathion   0.0330358   79.46466667
malathion   0.0330358   72.38866667
malathion   0   126.9333333
malathion   0   121.67
malathion   0   119.7866667
malathion   0   122.5866667
malathion   0   124.7966667
malathion   0   115.89
malathion   0   123.8833333
malathion   0   110.0333333
malathion   0.000165179 116.18
malathion   0.000165179 124.2333333
malathion   0.000165179 124.43
malathion   0.000165179 120.91
malathion   0.000165179 127.1433333
malathion   0.000165179 124.5166667
malathion   0.000165179 124.1233333
malathion   0.000165179 123.2733333
malathion   0.000330358 116.3966667
malathion   0.000330358 113.8566667
malathion   0.000330358 118.2233333
malathion   0.000330358 117.65
malathion   0.000330358 130.59
malathion   0.000330358 116.99
malathion   0.000330358 128.73
malathion   0.000330358 132.2633333
malathion   0.000660716 118.0866667
malathion   0.000660716 120.8366667
malathion   0.000660716 137.95
malathion   0.000660716 140.8133333
malathion   0.000660716 131.5766667
malathion   0.000660716 128.4933333
malathion   0.000660716 116.35
malathion   0.000660716 116.0533333
malathion   0.00991074  131.3766667
malathion   0.00991074  127.97
malathion   0.00991074  106.27
malathion   0.00991074  128.51
malathion   0.00991074  129.1933333
malathion   0.00991074  129.11
malathion   0.00991074  118.6566667
malathion   0.00991074  133.2266667
malathion   0.00330358  5.084333333
malathion   0.00330358  9.403
malathion   0.00330358  10.282
malathion   0.00330358  16.41733333
malathion   0.00330358  15.22466667
malathion   0.00330358  17.05166667
malathion   0.00330358  15.42333333
malathion   0.00330358  10.96066667
malathion   0.00991074  86.91966667
malathion   0.00991074  112.6866667
malathion   0.00991074  87.74533333
malathion   0.00991074  93.30566667
malathion   0.00991074  91.24
malathion   0.00991074  68.36633333
malathion   0.00991074  74.283
malathion   0.00991074  89.56033333
malathion   0.0330358   60.59233333
malathion   0.0330358   65.98166667
malathion   0.0330358   50.10833333
malathion   0.0330358   59.64166667
malathion   0.0330358   46.75333333
malathion   0.0330358   37.527
malathion   0.0330358   29.63333333
malathion   0.0330358   56.50933333
malathion   0.0991074   11.50933333
malathion   0.0991074   17.16733333
malathion   0.0991074   8.838666667
malathion   0.0991074   5.438666667
malathion   0.0991074   9.163
malathion   0.0991074   3.631
malathion   0.0991074   1.638333333
malathion   0.0991074   1.594666667
malathion   0.00330358  117.3933333
malathion   0.00330358  124.8766667
malathion   0.00330358  121.5266667
malathion   0.00330358  106.29
malathion   0.00330358  100.616
malathion   0.00330358  112.72
malathion   0.00330358  131
malathion   0.00330358  110.1666667
chlorpyrifos    0   87.22
chlorpyrifos    0   103.88
chlorpyrifos    0   104.28
chlorpyrifos    0   96.05
chlorpyrifos    0   113.14
chlorpyrifos    0   90.72
chlorpyrifos    0   130.55
chlorpyrifos    0   111.65
chlorpyrifos    0.000210354 83.69
chlorpyrifos    0.000210354 97.03
chlorpyrifos    0.000210354 113.9
chlorpyrifos    0.000210354 95.06
chlorpyrifos    0.000210354 99.65
chlorpyrifos    0.000210354 93.03
chlorpyrifos    0.000210354 64.27
chlorpyrifos    0.000210354 95.64
chlorpyrifos    0.000420708 75.39
chlorpyrifos    0.000420708 68.27
chlorpyrifos    0.000420708 92.03
chlorpyrifos    0.000420708 67.73
chlorpyrifos    0.000420708 64.54
chlorpyrifos    0.000420708 66.24
chlorpyrifos    0.000420708 56.03
chlorpyrifos    0.000420708 56.3
chlorpyrifos    0.000631062 53.95
chlorpyrifos    0.000631062 61.66
chlorpyrifos    0.000631062 76.73
chlorpyrifos    0.000631062 63.99
chlorpyrifos    0.000631062 71.53
chlorpyrifos    0.000631062 38.4
chlorpyrifos    0.000631062 35.21
chlorpyrifos    0.000631062 57.29
chlorpyrifos    0.000876475 46.82
chlorpyrifos    0.000876475 42.93
chlorpyrifos    0.000876475 38.22
chlorpyrifos    0.000876475 38.99
chlorpyrifos    0.000876475 59.17
chlorpyrifos    0.000876475 63.59
chlorpyrifos    0.000876475 27.61
chlorpyrifos    0.000876475 41.05
MONCOS  0   113.46
MONCOS  0   111.54
MONCOS  0   116.09
MONCOS  0   115.64
MONCOS  0   135.44
MONCOS  0   125.96
MONCOS  0   108.61
MONCOS  0   131.08
MONCOS  0   122.69
MONCOS  0   130.61
MONCOS  0   158.21
MONCOS  0   123.18
MONCOS  0   113.46
MONCOS  0   135.9
MONCOS  0   142.35
MONCOS  0   113.97
MONCOS  0   127.93
MONCOS  0   116.1
MONCOS  0   111.59
MONCOS  0   124.31
MONCOS  0   127.11
MONCOS  0   113.73
MONCOS  0   116.66
MONCOS  0   137.15
MONCOS  0   127.13
MONCOS  0   121.27
MONCOS  0   128.68
MONCOS  0   130.41
MONCOS  0   116.28
MONCOS  0   129.29
MONCOS  0   121.42
MONCOS  0   116.84
MONCOS  0   110.93
MONCOS  0   117.59
MONCOS  0   127.24
MONCOS  0   116.13
MONCOS  0   126.42
MONCOS  0   129.3
MONCOS  0   131.94
MONCOS  0.001257384 114.46
MONCOS  0.001257384 89.49
MONCOS  0.001257384 109.67
MONCOS  0.001257384 116.07
MONCOS  0.001257384 95.3
MONCOS  0.001257384 111.12
MONCOS  0.001257384 101.84
MONCOS  0.001257384 108.51
MONCOS  0.00506257  61.56
MONCOS  0.00506257  36.52
MONCOS  0.00506257  11.65
MONCOS  0.00506257  5.93
MONCOS  0.00506257  3.64
MONCOS  0.00506257  46.73
MONCOS  0.00506257  66.11
MONCOS  0.00506257  9.37
MONCOS  0.012672943 8.52
MONCOS  0.012672943 7.55
MONCOS  0.012672943 6.79
MONCOS  0.012672943 12.28
MONCOS  0.012672943 5
MONCOS  0.012672943 9.88
MONCOS  0.012672943 6.95
MONCOS  0.012672943 7.01
MONCOS  0.012672943 22.44
MONCOS  0.012672943 0.98
MONCOS  0.012672943 3.76

我使用log-logistic(3参数)模型分别绘制每个剂量响应曲线。

这就是我现在将三者结合起来的样子。

mixplot

这是我使用的代码(我使用三个.csv文件单独绘制文件):

mc2005.LL3 <- drm(average~moles, data=MONCOS, fct = LL.3())
summary(mc2005.LL3)
coeftest(mc2005.LL3)

plot(mc2005.LL3,  xlab=" moles", ylab="AChE activity percent of control",ylim=c(0,150), xlim=c(0, 0.1),type= "none", 
     cex=1.2, cex.axis=1.2, lwd=2)

plot(m2005.LL3, add=TRUE, type="none", lty=2, lwd=2, cex=1.2, cex.axis=1.2, col="blue")
plot(c2005.LL3, add=TRUE, broken=TRUE, type="none",  lty=3, lwd=3, cex=1.2, cex.axis=1.2, pch=20, col="red")

我尝试修复原始绘图的上部渐近线,但它总是将参数降低到两个。像这样:

mc2005.LL3 <- drm(average~moles, data=MONCOS, 
        fct = LL.3(fixed=c(NA,NA,100),
                   names=c("slope","Lower Limit","Upper Limit")))
summary(mc2005.LL3)

Model fitted: Log-logistic (ED50 as parameter) with lower limit at 0 (2 parms)

Parameter estimates:

                        Estimate Std. Error t-value p-value
slope:(Intercept)         1.7766         NA      NA      NA
Lower Limit:(Intercept)  90.9511     6.1111 14.8829       0

Residual standard error:

 49.64686 (64 degrees of freedom)

我不确定我做错了什么。有人可以给我一个暗示吗?

1 个答案:

答案 0 :(得分:0)

我对你在这里所要求的内容感到有点困惑,但我想你可能只需要在同一个drc模型中计算所有3个剂量响应曲线,并绘制而不是单独进行。我不知道为什么这会产生这样的差异。

All.LL3 <- drm(average~mol, Chemical, data=MONCOS, fct = LL.3())
plot(All.LL3,  xlab=" moles", ylab="AChE activity percent of control",ylim=c(0,150), 
 xlim=c(0, 0.1),type= "none", 
 cex=1.2, cex.axis=1.2, lwd=2, 
 col = c("blue", "red", "black"))

Plot with all 3 curves added within same drc model

摘要还提供了所有模型的所有参数

summary(All.LL3)
Model fitted: Log-logistic (ED50 as parameter) with lower limit at 0 (3 parms)

Parameter estimates:

             Estimate Std. Error    t-value p-value
b:malathion    5.2482e-01 6.7714e-02 7.7505e+00  0.0000
b:chlorpyrifos 1.4787e+00 5.0224e-01 2.9442e+00  0.0035
b:MONCOS       2.0173e+00 4.4216e-01 4.5623e+00  0.0000
d:malathion    1.2447e+02 4.5418e+00 2.7404e+01  0.0000
d:chlorpyrifos 1.0546e+02 8.2997e+00 1.2706e+01  0.0000
d:MONCOS       1.2377e+02 3.8917e+00 3.1804e+01  0.0000
e:malathion    1.6541e-02 3.8954e-03 4.2462e+00  0.0000
e:chlorpyrifos 6.9780e-04 1.2647e-04 5.5176e+00  0.0000
e:MONCOS       2.9630e-03 4.7046e-04 6.2981e+00  0.0000

Residual standard error:

 24.41421 (265 degrees of freedom)