5
$\begingroup$

can someone help me please?

How can I see the coeficient for municipio6:ano0, considering that I don't want to have a reference level in my model for municipio variable (that's why I set intercept to 0).

> m1 <- glm.nb(casos ~ 0 + municipio + ano0 + municipio:ano0 + offset(log(populacao)), data = dataset)
> summary(m1)

Call:
glm.nb(formula = casos ~ 0 + municipio + ano0 + municipio:ano0 + 
    offset(log(populacao)), data = dataset, init.theta = 1.202601993, 
    link = log)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.6965  -1.0652  -0.7363   0.3766   4.0045  

Coefficients:
                 Estimate Std. Error z value Pr(>|z|)    
municipio6      -12.22419    0.26220 -46.622  < 2e-16 ***
municipio1      -10.07937    0.16096 -62.621  < 2e-16 ***
municipio2      -10.15899    0.16450 -61.758  < 2e-16 ***
municipio3      -11.46408    0.20718 -55.333  < 2e-16 ***
municipio4      -11.12637    0.21401 -51.990  < 2e-16 ***
municipio5      -12.18312    0.26636 -45.739  < 2e-16 ***
ano0              0.06878    0.03153   2.181  0.02916 *  
municipio1:ano0  -0.09080    0.03802  -2.389  0.01692 *  
municipio2:ano0  -0.10842    0.03845  -2.820  0.00480 ** 
municipio3:ano0  -0.06582    0.04144  -1.588  0.11223    
municipio4:ano0  -0.14021    0.04388  -3.196  0.00139 ** 
municipio5:ano0   0.01989    0.04447   0.447  0.65471    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for Negative Binomial(1.2026) family taken to be 1)

    Null deviance: 24450.50  on 1008  degrees of freedom
Residual deviance:   989.11  on  996  degrees of freedom
AIC: 2863

Number of Fisher Scoring iterations: 1


              Theta:  1.203 
          Std. Err.:  0.134 

 2 x log-likelihood:  -2837.036
$\endgroup$

1 Answer 1

6
$\begingroup$

You actually need to remove the main effect of ano0. So your model formula should be

casos ~ 0 + municipio + municipio:ano0 + 
    offset(log(populacao))

I know it looks like you're omitting a term, but you will estimate exactly the same number of parameters and the model fit will be identical. This gives you an intercept and slope of ano0 for each level of municipio.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.