我正在尝试为我的数据导出误差线,它是成比例的(死/活)并使用二项式 GLM 进行分析。到目前为止,我已经尝试在 R 中使用 predict() 函数,但在没有死亡或 100% 死亡的治疗组中,误差线非常大(基本上覆盖 0%-100%)。我的代码有问题吗?或者有没有更简单的方法来计算 CI 或标准误差线?
A<-c(10,10,10,10,10,10,19,19,19,19,19,19)
B<-c("0","1","2","0","1","2","0","1","2","0","1","2")
C<-c("-ve","-ve","-ve","+ve","+ve","+ve","-ve","-ve","-ve","+ve","+ve","+ve")
Dead<-c(1,1,27,0,6,18,2,10,23,0,14,21)
Alive<-c(29,32,2,22,19,4,28,22,3,20,11,0)
Total<-Dead+Alive
gaf<-data.frame(A,B,C,Dead,Alive,Total)
mod2<-glm(cbind(Dead,Alive)~A*B*C, family=binomial)
p<-predict(mod2,newdata=gaf,se.fit=TRUE)
up<-with(p,fit+se.fit)
low<-with(p,fit-se.fit)
invLink<-family(mod2)$linkinv
av2<-with(p,invLink(fit))
upr<-invLink(up)
lwr<-invLink(low)