0
$\begingroup$

I am trying to do a Poisson regression using the following data, where infant deaths are shown per year for both North and South England.

ageband agecat midage year deaths population Divide Gender percentage
2965    <01 <01 0.5 1965    5033    214400  North   1   2.3474813
989     <01 <01 0.5 1965    3952    199000  South   1   1.9859296
2984    <01 <01 0.5 1966    4999    210900  North   1   2.3703177
1008    <01 <01 0.5 1966    3850    196900  South   1   1.9553073
3003    <01 <01 0.5 1967    4663    208700  North   1   2.2343076
1027    <01 <01 0.5 1967    3525    194200  South   1   1.8151390
3022    <01 <01 0.5 1968    4603    204400  North   1   2.2519569
1046    <01 <01 0.5 1968    3616    188400  South   1   1.9193206
3041    <01 <01 0.5 1969    4507    204100  North   1   2.2082313

This is what I am running in R: (nsmaleMerge is my data), am I correctly using the offset parameter or should I not be enclosing it in a log function?

poissonM <- glm(deaths~Divide, nsmaleMerge, offset(log(population)), family = poisson(link = "log"))

Deaths is the count variable as seen from the data, and divide (north/south) is the covariate, exposure would be population.

When I try doing 'offset = population' without the log function I get an error about not including start values, but when I do it with the log function as seen above it works fine and this is the output:

    Call:
glm(formula = deaths ~ Divide, family = poisson(link = "log"), 
    data = nsmaleMerge, weights = offset(log(population)))

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-108.82   -77.21   -28.82    32.27   203.75  

Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)  7.5750418  0.0009075    8347   <2e-16 ***
DivideSouth -0.1843193  0.0013457    -137   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 808081  on 103  degrees of freedom
Residual deviance: 789242  on 102  degrees of freedom
AIC: 800662

Number of Fisher Scoring iterations: 5

Do I need to do the log function, or do I have an error in my data when trying to use population by itself under offset?

$\endgroup$
1
$\begingroup$

It is a programming error.

The fourth argument of glm is weights, not offset. So either use named arguments or add the offset to the formula like + offset(log(population)).

$\endgroup$
2
$\begingroup$

With the offset, you are saying that you look at expected infant deaths per member of the population per year with the theoretical possibility of more than one infant death per year per member of the population. Your model for the mean rate of the Poisson distribution is: $$\log E Y_i = {\bf x_i\beta_i} + \log \text{population},$$ which you can rewrite as $$\log E (Y_i/\text{population}) = {\bf x_i\beta_i}.$$

You may be able to judge whether that is a sensible model and/or whether another denominator (e.g. I do not even know what population means, is it the total population of all ages or of infants?) or distribution makes more sense. E.g. if "population" is a population of infants, you could also look at it as a binomial outcome (each infant either dies or does not die), or you could try to take into account partial years at risk (by counting total years of infants at risk, in which case a Poisson model makes a lot of sense) etc.

$\endgroup$
  • $\begingroup$ Thanks for the explanation, yes population is a population of infants for that specific year, I have the data from 1965-2016. What do you mean by "you could try to take into account partial years at risk (by counting total years of infants at risk"? The model currently is for all years, are you saying to do e.g. every 10 years? Also do you have any information or references that could help me interpret the output of the model and what it means, thanks. $\endgroup$ – yahyalogde Jun 11 at 13:34
  • $\begingroup$ What meant is if some infants only live in the area for half the year (=0.5 years at risk), or die half way through the year (=only 0.5 years at risk) or are born after 3 months (=0.75 years at risk in the year), move away after 3/4 of the year (=0.75 y at risk) etc. (an infant that is there for the whole year counts as 1y at risk), you can sum up the time at risk and use the logarithm of that as an offset. You may not have the necessary data though. Any good reference that explains generalized linear models would be a good starting point, there are plenty pitched at different audiences. $\endgroup$ – Björn Jun 11 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.