[R] glm or transformation of the response?
P.Dalgaard at biostat.ku.dk
Tue Nov 25 16:55:04 CET 2008
Christoph Scherber wrote:
> Dear all,
> For an introductory course on glm?s I would like to create an example to
> show the difference between glm and transformation of the response. For
> this, I tried to create a dataset where the variance increases with the
> mean (as is the case in many ecological datasets):
> However, I have run into a problem because it looks like the lm model
> (with sqrt-transformation) fits the data best:
> The only model that performs equally well is model7.
> How would you deal with this kind of analysis? What would be your
> recommendation to the students, given the fact that most of the standard
> glm models obviously don?t seem to produce good fits here?
> Many thanks and best wishes
> (using R 2.8.0 on Windows XP)
Any good reason that you're not transforming both sides when
transforming? and that you're not looking at
model8 <- glm(response~log(explanatory),poissondata,family=poisson)
BTW, your predict call seems to be missing data.frame() around
"explanatory=explanatory". The predict() methods do not have an argument
called "explanatory", so this is just ignored (a buglet if you ask me).
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help