我有两个小数据集:
infected.data.r.p <- structure(list(MLH = c(0.520408163265306, 0.436170212765957,
0.344086021505376, 0.423076923076923, 0.406976744186047), ColGrowthCL_6 = c(5.923728814,
0.283950617, 0.377358491, 1.728070175, 0.2)), .Names = c("MLH",
"ColGrowthCL_6"), row.names = c("12", "22", "28", "30", "34"), class = "data.frame")
和
uninfected.sampling <- structure(list(MLH = c(0.524271844660194, 0.457446808510638,
0.354838709677419, 0.398058252427184, 0.436893203883495), ColGrowthCL_6 = c(4.401639344,
4.827586207, 6.387096774, 6.320754717, 4.225490196)), .Names = c("MLH",
"ColGrowthCL_6"), row.names = c("218", "18", "21", "212", "99"
), class = "data.frame")
当我尝试使用 R 中的 anova() 语法比较这两个模型时(见下文),它无法产生 p 值。我不相信是这两个数据集的性质导致了问题(尽管我也很好奇这两个数据集的结构到底有什么不同),但我想这很可能是问题所在. 谢谢!
模型比较语法:
infected.model<-glm(formula=as.formula(ColGrowthCL_6~MLH), family=poisson, infected.data.r.p)
uninfected.model<-glm(formula=as.formula(ColGrowthCL_6~MLH), family=poisson, uninfected.sampling)
compare<-anova(infected.model,uninfected.model,test="Chisq")
print(compare)
summary(compare)