Displaying 1 result from an estimated 1 matches for "sandwichglm".
2008 May 08
2
poisson regression with robust error variance ('eyestudy
...C0 type of robust standard errors in
the "sandwich" package (thanks to Achim Zeileis), you get "almost" the
same numbers as that Stata output gives. The estimated b's from the
glm match exactly, but the robust standard errors are a bit off.
### Paul Johnson 2008-05-08
### sandwichGLM.R
system("wget http://www.ats.ucla.edu/stat/stata/faq/eyestudy.dta")
library(foreign)
dat <- read.dta("eyestudy.dta")
### Ach, stata codes factor contrasts backwards
dat$carrot0 <- ifelse(dat$carrot==0,1,0)
dat$gender1 <- ifelse(dat$gender==1,1,0)
glm1 <- glm(le...