[英]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 中的广义估计方程来获得独立分类变量的总体 p 值。 当我运行分析时,output 为分类变量的每个级别提供 p 值,而不是变量本身的整体 p 值。
output 的一个示例是:
Call:
geeglm(formula = modality ~ factor(smoking_status), family = "binomial",
data = airleak_cleaned_included, id = as.factor(mrn))
Coefficients:
Estimate Std.err Wald Pr(>|W|)
(Intercept) 0.875 0.266 10.82 0.001 **
factor(smoking_status)1 -0.359 0.338 1.13 0.287
factor(smoking_status)2 -1.099 0.722 2.32 0.128
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation structure = independence
Estimated Scale Parameters:
Estimate Std.err
(Intercept) 1 0.0597
Number of clusters: 176 Maximum cluster size: 1
(任何人看到这个,请投票迁移。)我发布了一个“答案”,但我真的不希望它被认为是这样,因为我没有太多的统计理论。 I can show the mechanics of getting a result using R, but I have seconded Limey's vote to migrate to stats.stackexchange.com after I searched that site for an answer to the general question of "how to do a principled model comparison" on GEE建模结果以从这些 GEE 中获得“总体显着性”估计。 在 SO 或 CV.com 上,我没有找到我认为令人满意的答案。
此代码安装并加载 R 库“geepack”,然后基于?geeglm
anova
的示例代码构建 2 个模型(其中一个将公式的 RHS 设置为1
以构建“空模型”),然后在两个模型。 package 确实有anova.geeglm
function ,我认为这意味着作者认为这至少在某些情况下是有效的。
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
如果这是“常规”回归,我相信这是 model 比较的有效方法,并且嵌套模型之间的 X^2 差异为 9327,自由度相差 11 度,表明“统计显着性”较高,相应的低 p 值。 但是,我适度谦虚,因为这是一个我没有经验的统计领域。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.