我一直在对数据进行分析,其中Alive
或Dead
表示在压力条件下设定Time
后存活的动物数量。
EG。
Trial Time Alive Dead
1 1 0.0 100 0
2 1 2.0 0 10
3 1 6.0 0 12
4 1 9.0 0 10
5 1 12.0 0 10
6 2 0.0 100 0
7 2 0.5 10 0
8 2 1.0 10 0
9 2 1.5 10 0
10 2 2.0 8 2
11 3 0.0 100 0
12 3 0.5 10 0
13 3 1.0 10 0
14 3 1.5 10 0
15 3 2.0 9 1
16 3 2.5 7 1
17 3 3.0 2 9
18 3 3.5 3 5
使用glm和来自dose.p
的{{1}}函数我已经能够使用其他似乎与绘制曲线匹配的数据集来计算LT50但是由于某种原因我遇到了这些特定数据的问题
MASS
在您仔细查看数据之前,这似乎没问题:
Time=c(0.0, 2.0, 6.0, 9.0, 12.0, 0.0, 0.5, 1.0, 1.5, 2.0, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5)
Alive=c(100, 0, 0, 0, 0, 100, 10, 10, 10, 8, 100, 10, 10, 10, 9, 7, 2, 3)
Dead=c(0, 10, 12, 10, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 1, 9, 5)
Trial=c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3)
model=glm(cbind(Alive, Dead)~Time+Trial, family=binomial(link="logit"))
Call:
glm(formula = cbind(Alive, Dead) ~ Time + Trial, family = binomial(link = "logit"),
data = cinctipesA)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7008 0.0000 0.1171 0.3567 2.2157
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.0893 1.2559 2.460 0.0139 *
Time -4.0455 0.7159 -5.651 1.60e-08 ***
Trial 2.9112 0.7096 4.103 4.08e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 309.566 on 17 degrees of freedom
Residual deviance: 14.092 on 15 degrees of freedom
AIC: 31.203
Number of Fisher Scoring iterations: 9
dose.p(model, cf=1:2 p=0.5)
Dose SE
p = 0.5: 0.7636405 0.2927676
从这个情节可以看出,%50%的人死亡的时间点不在coef(model)
logisticline = function(z) {eta = 3.089321 + (-4.045518+2.911239) * z; 1 / (1 + exp(-eta))}
x = seq(0,12, 0.01)
lines(x, logisticline(x), new = TRUE)
abline(0.5, 0)
。
为什么使用这些特定数据计算LT50有问题?