if (requireNamespace("geepack", quietly = TRUE)) {
library(geepack)
data(dietox, package = "geepack")
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")
V_CR <- vcovCR(gee1, cluster = dietox$Pig, type = "CR2")
coef_test(gee1, vcov = V_CR, test = "Satterthwaite")
}
Run the code above in your browser using DataLab