问题
Just want to check that what I'm doing is all correct!
I have bird counts in several sites categorised into two habitats - farmland and wetland. I simply want to see which habitat has higher counts.
I'm using a GLM with a Poisson function (as they are count data):
> mod <- glm(count ~ habitat, family = "poisson")
> summary(mod)
Call:
glm(formula = count ~ habitat, family = poisson)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.5868 -0.4603 -0.2496 -0.2141 2.8464
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.2695 1.0000 -0.269 0.788
habitatWetland 1.7331 1.0954 1.582 0.114
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 37.802 on 91 degrees of freedom
Residual deviance: 34.373 on 90 degrees of freedom
AIC: 48.987
Number of Fisher Scoring iterations: 6
So far so good?
My understanding is that (using the default contrasts) the Intercept refers to habitat:Farmland - so the estimated average count on farmland sites would be exp(-0.2695). The estimated average count on wetland would be exp(1.7331).
The intercept p-value (0.788) gives the probability that the intercept (i.e. count in farmland) is significantly greater than zero (although I'm not particularly interested in this). The wetland p-value (0.114) gives the probability that the count in wetland is different from the intercept (i.e. different from the count in farmland). So in this case there is no significant (at the 5% level) difference between the two habitat types.
Is that all correct? Anything else I should be thinking of or doing differently?
回答1:
Close but for wetland the rate is exp(-0.2695 + 1.7331)
, and your understanding of p-values is off. The p-value is not the probability that the alternative hypothesis is true; it is the chance of seeing data at least as extreme as observed if the null hypothesis were true (and you were to collect more data under similar circumstances).
The p-value for the intercept is rarely useful. From the p-value for the other coefficient (0.114), it is clear you do not have evidence of a difference between wetland and farmland.
来源:https://stackoverflow.com/questions/47891566/checking-interpretation-of-glm-summary-in-r