R-helpers, I am hoping to find someone who uses both R and program Stata for GLMs.
I am a beginner R user, finding my own way through; learning code etc. at the same time as learning the statistics I need to complete my project. What I have is the code from Stata and am trying to reproduce the same analysis in R - my program of choice. . glm count md ms rf sg, family(poisson) exposure(effort) eform I am lost at the point of finding the equivalent code for 'exposure'. Having looked at a few forums and 'googled'. I thought 'offset', used as offset=(log(Eff)) or the equivalent +offset(log(Eff)) would produce the desired effect. Incidentally my code was: glm(Count~md+ms+rf+sg+offset(Eff),family=poisson,data=DepthHabGen) (Making use of glm{stats}) However, offset does not seem to be equivalent to 'exposure' in Stata. As coefficients and log likelhood estimates differ. So I asked the following questions: 1. Do both programs produce the same results without 'exposure' i.e. glm models Yes, log likelihoods and coefficients are the same. 2. How about using the unintuitive non logged " offset=Eff" ? Coefficients and log likelihoods still differ. So now I defer to those with more experience, does anyone know how to produce the equivalent of Stata's glm 'exposure' in R? Thank you in advance, Columbine [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.