I am using R to calculate odds ratios for several univariate models with a binomial outcome.
The problem is, for some of my variables, I am getting the following error glm.fit: fitted probabilities numerically 0 or 1 occurred
. I have found that these variables commonly have at least 1 zero count cell.
It seems that the Haldane correction (0.5 is added to all cells of the contingency table) is commonly used when there is a zero count cell for a 2x2 contingency table. However, some of my variables have more than 2 levels.
Can I apply the Haldane correction for my variables with >2 categorical levels? Or, is there an alternate recommendation to fix this problem?