[R] Poisson regression
Federico Gherardini
f.gherardini at pigrecodata.net
Fri Oct 29 21:43:29 CEST 2004
Dear all,
First of all sorry if this is a dumb question...
I'm trying to fit a linear model between the logarithm of two numerical
variables (log(y) ~ log(x)). A log-log plot shows that the variance of
log(y) is decreasing with the mean of log(x), in other words the points
are quite dispersed for low values of log(x) and approach a straight
line as log(x) increases. I have tried the following glm model
fit <- glm(y ~ log(x), data = tab, family = poisson)
The residuals seem very good but I have a doubt: I have used y and not
log(y) in the model formula because, as far as I understand, the
poisson regression assumes a logarithmic transformation of the response.
Is this correct? I mean is it correct to watch a y ~ log(x) poisson
regression line on a log(y) ~ log(x) xyplot or I am confusing the two
things?
Thank you very much
Federico
More information about the R-help
mailing list