【发布时间】:2014-01-21 14:08:15
【问题描述】:
我正在尝试从引导的 GLM 输出列表中计算 LC50
我在一个列表(命名结果)中有引导 GLM 的输出,如下所示: (为方便起见,我只是放入了最后一个结果,而不是整个列表)
$thetastar[[100]]
Call: glm(formula = dead[x] ~ concentration[x] + factor(female.no[x]),
family = binomial, data = subset.data.48hr)
Coefficients:
(Intercept) concentration[x] factor(female.no[x])3 factor(female.no[x])4 factor(female.no[x])7
0.7386 0.1869 -0.8394 -5.6613 -2.9576
factor(female.no[x])8 factor(female.no[x])9
-1.5329 -2.7826
Degrees of Freedom: 354 Total (i.e. Null); 348 Residual
(1265 observations deleted due to missingness)
Null Deviance: 484.2
Residual Deviance: 257 AIC: 271
使用 MASS 包中的 dose.p 我正在尝试计算已运行模型中每个人的 LC50
dose.p(results$thetastar[[100]], cf = c(2,3), p = 0.5)
返回
Dose SE
p = 0.5: 0.2227249 0.161769
据我了解,这是 factor(female.no[x])3. 的 LC50,即 dose.p 我已将 cf = c(2,3) 放入第 2 列和第 3 列,concentration 和 factor(female.no[x])3.
这是正确的吗?
其次:
有没有一种方法可以让每个女性获得 LC50,即factor(female.no[x])3、factor(female.no[x])4、factor(female.no[x])7 等等,我不知道如何让dose.p 工作在不同的变量无需手动更改代码cf=:
dose.p(results$thetastar[[100]], cf = c(2,3), p = 0.5)
dose.p(results$thetastar[[100]], cf = c(2,4), p = 0.5)
dose.p(results$thetastar[[100]], cf = c(2,4), p = 0.5)
最后:
我的结果存储在一个列表中,我如何让dose.p 沿着列表工作,是不是类似于:
test=matrix
for(i in 1:results){
test[i,]= dose.p(results$thetastar[[i]], cf = c(2,3), p = 0.5)
感谢您的帮助
【问题讨论】:
标签: r list glm statistics-bootstrap