[R] predict GLM with offset MASS

smfa smfalves at gmail.com
Sat Apr 14 01:49:38 CEST 2012


Hi, 

I know this is probably a stupid question... But I don't seem to find the
answer. 

I'm fitting a GLM with a Poisson family, using MASS, and then tried to get a
look at the predictions, however the offset does seem to be taken into
consideration:

model_glm=glm(cases~rhs(data$year,2003)+lhs(data$year,2003),
offset=(log(population)), data=data, subset=28:36, family=poisson())

predict (model_glm, type="response")

I get cases not rates...

I've tried also

model_glm=glm(cases~rhs(data$year,2003)+lhs(data$year,2003)+
offset(log(population)), data=data, subset=28:36, family=poisson())

with the same results. However when I predict from GAM, using mgcv, the
predictions consider the offset (I get rates).

I'm missing something?

I would appreciate any comment,

thanks

Sandra



--
View this message in context: http://r.789695.n4.nabble.com/predict-GLM-with-offset-MASS-tp4556308p4556308.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list