How do I get the robust standard errors/sandwich variance estimators for GLM using a Gamma family with a log-link to match the robust standard errors from the GEE output?
library(sandwich)
library(lmtest)
data('CO2')
up_glm <- glm(uptake ~ Type, data = CO2, family = Gamma(link = 'log'))
up_gee <- gee::gee(uptake ~ Type , data = CO2, id = Plant, family = Gamma(link = 'log'))
up_gee_glm <- geepack::geeglm(uptake ~ Type , data = CO2, id = Plant, family = Gamma(link = 'log'))
summary(up_glm)$coefficients[,1:2]
coeftest(up_glm, vcov = vcovCL, cluster = CO2$Plant)
summary(up_gee)$coefficients[,c(1,2,4)]
summary(up_gee_glm)$coefficients[,1:2]
I've tried to follow this post and these directions but neither give me the robust SE that match the GEE output.
gee. You need to use thecadjustargument. – Benjamin Christoffersen Jul 07 '20 at 14:34gee::geegives you or those that you get from SAS and STATA? This is not clear from your post or from the tile of your post. Could you edit your post to make this clear? – Benjamin Christoffersen Jul 07 '20 at 14:40