Displaying 2 results from an estimated 2 matches for "eyestudy".
2004 Jun 02
2
poisson regression with robust error variance ('eyestudy')
Dear all,
i am trying to redo the 'eyestudy' analysis presented on the site
http://www.ats.ucla.edu/stat/stata/faq/relative_risk.htm
with R (1.9.0), with special interest in the section on "relative risk
estimation by poisson regression with robust error variance".
so i guess rlm is the function to use. but what is its equiva...
2008 May 08
2
poisson regression with robust error variance ('eyestudy
...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(lenses~carrot0, data=dat, family=poisson(link=log))
summary(glm1)
l...