# Odds ratio with zero cell counts

I am trying to run a binomial GLM but have some zero cell counts resulting in estimates of +/- infinity. In the text book "An Introduction to Categorical Data Analysis" Agresti A. (1996) it suggests to add a small constant to the zero cells - which I also came across in the more accessible paper here.

However, when I try this in R I get a warning message of:

non-integer counts in a binomial glm!.

So:

1. I'm not sure if this is the right thing to do?
2. Is there a better way to deal with zero cell counts?

Data:

A<-c(10,10,10,10,10,10,19,19,19,19,19,19)
B<-c("0","1","2","0","1","2","0","1","2","0","1","2")
C<-c("-ve","-ve","-ve","+ve","+ve","+ve","-ve","-ve","-ve","+ve","+ve","+ve")
Alive<-c(29,32,2,22,19,4,28,22,3,20,11,0)

• This doesn't help with the zero cell-count problem but I noticed that you create the object gaf but never use it anywhere in the code; the glm call only looks at the vectors Dead and Alive etc, rather than the data.frame where you collected them together. – Sycorax says Reinstate Monica Sep 12 '13 at 12:53
• Thanks - I used it later but forgot to remove it for this question – user29689 Sep 12 '13 at 12:59

I think the confusion is stemming from the fact that in a binomial glm formula the mean proportion of deaths cannot be zero. It's ok for some of your observed proportions of deaths to be zero. The fitting procedure isn't simply taking the log of Dead/Alive, it's finding the maximum likelihood estimates for the following model: \begin{eqnarray} Y_i &\sim& Bin\left( m_i, \mu_i \right), ~~~~\text{for}~~ i=1,...,n, \\ \log\frac{\mu_i}{1-\mu_i} &=& \beta_0 + \beta_1 A_i + \beta_2 B_i + \beta_3 C_i. \end{eqnarray} I know your A, B and C covariates are actually factors but the story is the same. If your observed response $y_i$ is zero, your modelling assumption is that the probability of death $\mu_i$ in this case is probably very low, so that in a random sample of $m_i$ observations you may well see no deaths (which is in fact what you've observed here).
• Do you mean intervals for each $\mu_i$? How are you calculating them? – Sam Livingstone Sep 12 '13 at 14:08