Reputation: 21
I'm having trouble with the running of a log-log regression model with Poisson. How should I prevent this warning message? It's also the first time that I use Poisson so I really don't know how to do. Thanks a lot
sardegnalog.lm <-glm(log1p(fulldata[381:400,1])~log1p(fulldata[381:400,2])+log1p(fulldata[381:400,3])+log1p(fulldata[381:400,4])+log1p(fulldata[381:400,8]), family="poisson")
Warning messages:
1: In dpois(y, mu, log = TRUE) : non-integer x = 8.868132
2: In dpois(y, mu, log = TRUE) : non-integer x = 9.885069
3: In dpois(y, mu, log = TRUE) : non-integer x = 9.410911
4: In dpois(y, mu, log = TRUE) : non-integer x = 7.876259
5: In dpois(y, mu, log = TRUE) : non-integer x = 11.826326
6: In dpois(y, mu, log = TRUE) : non-integer x = 9.632728
7: In dpois(y, mu, log = TRUE) : non-integer x = 9.872616
8: In dpois(y, mu, log = TRUE) : non-integer x = 6.899723
9: In dpois(y, mu, log = TRUE) : non-integer x = 9.027379
10: In dpois(y, mu, log = TRUE) : non-integer x = 16.733528
summary(sardegnalog.lm)
Call:
glm(formula = log1p(fulldata[381:400, 1]) ~ log1p(fulldata[381:400,
2]) + log1p(fulldata[381:400, 3]) + log1p(fulldata[381:400,
4]) + log1p(fulldata[381:400, 8]), family = "poisson")
Deviance Residuals:
Min 1Q Median 3Q Max
-3.267 -2.082 -1.093 1.085 3.123
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -17.5129 5.2594 -3.330 0.000869 ***
log1p(fulldata[381:400, 2]) 1.3144 0.4632 2.838 0.004544 **
log1p(fulldata[381:400, 3]) 0.7884 0.2384 3.307 0.000944 ***
log1p(fulldata[381:400, 4]) -0.1477 0.2613 -0.565 0.571836
log1p(fulldata[381:400, 8]) -0.7765 0.2960 -2.623 0.008715 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 144.602 on 19 degrees of freedom
Residual deviance: 80.231 on 15 degrees of freedom
AIC: Inf
Number of Fisher Scoring iterations: 6
Upvotes: 1
Views: 1535
Reputation: 8252
It's difficult to be certain because you haven't been sufficiently explicit about the model, but it looks like you need to simply drop the log1p
on the left hand side of the formula; the Poisson glm already has a log link function by default (but you don't need to add 1, because it's the mean, not the data that is transformed to the scale of the linear predictor).
You would still need it on the right though.
Upvotes: 0