Displaying 1 result from an estimated 1 matches for "poissondata".
2008 Nov 25
4
glm or transformation of the response?
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):
poissondata=data.frame(
response=rpois(40,1:40),
explanatory=1:40)
attach(poissondata)
However, I have run into a problem because it looks like the lm model (with sqrt-transformation)
fits the data best:
##
model1=lm(response~explanatory,poissondata)
model2=lm(sqrt(response+0.5)~explanatory,poissondata...