[R] transforming data glm
Mcdonald, Grant
grant.mcdonald08 at imperial.ac.uk
Mon Aug 24 12:47:57 CEST 2009
Dear sir,
I am fitting a glm with default identity link:
model<-glm(timetoacceptsecs~maleage*maletub*relweight*malemobtrue*femmobtrue)
the model is overdisperesed and plot model shows a low level of linearity of the residuals. The overdispersion and linearity of residulas on the normal Q-Q plot is corrected well by using:
model<-glm(log(timetoacceptsecs)~maleage*maletub*relweight*malemobtrue*femmobtrue))
Boxcox of my model also suggests that the log transformation is what i should do.
I ask how i am able to do this by changing the link function or error family of my glm and not diretly taking the log of the response variable.
For instance:
model<-glm(log(timetoacceptsecs)~maleage*maletub*relweight*malemobtrue*femmobtrue, family=poisson))
does not improve my model in terms of overdispersion etc as much as taking the log.
Thank you
More information about the R-help
mailing list