介绍R和SPSS做广义估算方程GEE
R geepack包
详细教程:https://cran.r-hub.io/web/packages/geepack/geepack.pdf
geepack::geeglm函数
geeglm的语法类似于glm,并返回类似于glm对象的object。geeglm的一个重要特征是,对于这些模型存在ananova方法。
geeglm(formula,
family = gaussian,
data = parent.frame(),
weights,
subset,
na.action,
start = NULL,
etastart,
mustart,
offset,
control = geese.control(...),
method = "glm.fit",
contrasts = NULL,
id,
waves = NULL,
zcor = NULL,
corstr = "independence",
scale.fix = FALSE,
scale.value = 1,
std.err = "san.se",
)
gee1 < - geeglm(mf2, data=dietox, id=Pig, family=poisson("identity"), corstr="ar1")
anova(gee2)
结果:
coef(gee1)
vcov(gee1)
summary(gee1)
coef(summary(gee1)