# Log-linear model, Poisson regression, categorical variable with 100 levels

I want to compare the incidence rate(asum) of 100 different cities(cityID) to see if there are significant differences among them. Given that the incidence rate is following Poisson, so it is a log-linear model.

m0=glm(asum~cityID, family=poisson, data=suit)
summary(m0)

However, the result looks so clumsy and stupid. Have I done anything wrong? Or is there any better way to analyse the data for my purpose?

Call:
glm(formula = asum ~ cityID, family = poisson, data = suit)

Deviance Residuals:
[1]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
[25]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
[49]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
[73]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
[97]  0  0  0  0

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)  3.63759    0.16222  22.424  < 2e-16 ***
cityID2      1.68542    0.17662   9.543  < 2e-16 ***
cityID3      1.79614    0.17516  10.254  < 2e-16 ***
cityID4      2.17355    0.17120  12.696  < 2e-16 ***
cityID5      1.02585    0.18908   5.426 5.78e-08 ***
cityID6      2.20306    0.17095  12.887  < 2e-16 ***
:
:
:
cityID90     0.92676    0.19166   4.836 1.33e-06 ***
cityID91     1.28239    0.18334   6.994 2.66e-12 ***
cityID92     2.40267    0.16940  14.183  < 2e-16 ***
cityID93     1.39937    0.18113   7.726 1.11e-14 ***
cityID94    -1.23969    0.34238  -3.621 0.000294 ***
cityID95     0.59652    0.20201   2.953 0.003148 **
cityID96    -2.25129    0.52566  -4.283 1.85e-05 ***
cityID97     1.86367    0.17435  10.689  < 2e-16 ***
cityID98     1.82625    0.17479  10.448  < 2e-16 ***
cityID99     1.96453    0.17322  11.341  < 2e-16 ***
cityID100    0.93712    0.19138   4.897 9.74e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for poisson family taken to be 1)

Null deviance: 1.0608e+04  on 99  degrees of freedom
Residual deviance: 2.8200e-14  on  0  degrees of freedom
AIC: 804.18

Number of Fisher Scoring iterations: 3

UPDATE

m2=glm(asum~cityID+rainpd+temppd+distLon+offset(I(pop/1e5)), family=poisson, data=suit2)
> summary(m2)

cityID98     1.07292    0.03568  30.071  < 2e-16 ***
cityID99     0.88466    0.03536  25.020  < 2e-16 ***
cityID100    0.70534    0.03906  18.056  < 2e-16 ***
rainpd            NA         NA      NA       NA
temppd            NA         NA      NA       NA
distLon           NA         NA      NA       NA
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for poisson family taken to be 1)

Null deviance: 6.6337e+04  on 2399  degrees of freedom
Residual deviance: 3.6238e-13  on 2300  degrees of freedom
AIC: 14700
• I appreciate this is not a direct answer to your question but would you not want to include an offset to account for city size? Apr 27, 2016 at 12:19
• @mdewey I have done that already, and the result is similar. I am looking for a more high-level solution that altered the method of analysis. Apr 27, 2016 at 14:56
• Mar 6, 2020 at 23:24

The fact that you are getting all the deviance residuals equal to zero suggests that your model is saturated in parameters, you are fitting one parameter per observation. Another way of looking at this is that city 1 must have a count of 38 $=e^{3.63759}$ and city 2 205 $=e^{3.63759+1.68542}$ and so on.