[英]How to get an overall p-value for an independent categorical variable using generalized estimating equations (geeglm) in R
[英]How to get an overall p-value for an independent categorical variable using generalized estimating equations (geeglm) in R
(任何人看到这个,请投票迁移。)我发布了一个“答案”,但我真的不希望它被这样认为,因为我没有太多的统计理论。 我可以展示使用 R 获得结果的机制,但在我搜索该网站以回答 GEE 上“如何进行有原则的模型比较”的一般问题后,我支持 Limey 的投票以迁移到 stats.stackexchange.com建模结果以从这些 GEE 中获得“总体显着性”估计。 我在 SO 或 CV.com 上都没有找到我认为令人满意的答案。
此代码安装并加载 R 库“geepack”,然后基于?geeglm
anova
的示例代码构建 2 个模型(其中一个将公式的 RHS 设置为1
以构建“空模型”),然后在两个模型。 该包确实有一个anova.geeglm
函数,我认为这意味着作者认为这至少在某些情况下是有效的。
install.packages('geepack')
library(geepack)
data(dietox)
dietox$Cu <- as.factor(dietox$Cu)
mf <- formula(Weight ~ Cu * (Time + I(Time^2) + I(Time^3)))
gee1 <- geeglm(mf, data=dietox, id=Pig, family=poisson("identity"), corstr="ar1")
# warnings noted
gee1
coef(gee1)
vcov(gee1)
summary(gee1)
coef(summary(gee1))
mf2 <- formula(Weight ~ 1)
gee2 <- geeglm(mf2, data=dietox, id=Pig, family=poisson("identity"), corstr="ar1")
# more warnings
methods("anova") # to get available class-specific function names
[1] anova.coxph* anova.coxphlist* anova.geeglm* anova.glm* anova.glmlist* anova.glmmPQL*
[7] anova.lm* anova.lmlist* anova.loess* anova.loglm* anova.mlm* anova.negbin*
[13] anova.nls* anova.polr* anova.survreg* anova.survreglist*
see '?methods' for accessing help and source code
anova(gee1,gee2)
#---------------
Analysis of 'Wald statistic' Table
Model 1 Weight ~ Cu * (Time + I(Time^2) + I(Time^3))
Model 2 Weight ~ 1
Df X2 P(>|Chi|)
1 11 9327 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
如果这是“常规”回归,我相信这是一种有效的模型比较方法,并且嵌套模型之间相差 11 个自由度的 X^2 差异为 9327 表明“统计显着性”和相应的低 p 值。 但是,我适度谦虚,因为这是一个我没有经验的统计领域。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.