# How should you handle cell values equal to zero in a contingency table?

How should you deal with a cell value in a contingency table that is equal to zero in statistical calculations? (Note that such a value can be structural, i.e., it must be zero by definition, or random, i.e., it could have been some other value, but zero was observed.)

• More info is needed here, by zero do you mean missing? Why do you think you have to do something special because the value is zero?
– Glen
Feb 13 '11 at 14:39
• I would close it as duplicate stats.stackexchange.com/questions/1444/… Feb 13 '11 at 19:04
– DWin
Feb 13 '11 at 19:41

A very nice discussion of structural zeros in contingency tables is provided by West, L. and Hankin, R. (2008), “Exact Tests for Two-Way Contingency Tables with Structural Zeros,” Journal of Statistical Software, 28(11), 1–19. URL http://www.jstatsoft.org/v28/i11

As the title implies, they implement Fisher’s exact test for two-way contingency tables in the case where some of the table entries are constrained to be zero.

• Agresti and Finlay mention that generalizing Fisher's exact test also makes sense when cell counts fall below 5 in any contingency table.
– Fr.
Mar 13 '11 at 15:37

Zeros in tables are sometimes classified as structural, i.e.zero by design or by definition, or as random, i.e. a possible value that was observed. In the case of a study where no instances were observed despite being possible, the question often comes up: What is the one-sided 95% confidence interval above zero? This can be sensibly answered. It is, for instance, addressed in "If Nothing Goes Wrong, Is Everything All Right? Interpreting Zero Numerators" Hanley and Lippman-Hand. JAMA. 1983;249(13):1743-45. Their bottom line was that the upper end of the confidence interval around the observed value of zero was 3/n where n was the number of observations. This "rule of 3" has been further addressed in later analyses and to my surprise I found it even has a Wikipedia page. The best discussion I found was by Jovanovic and Levy in the American Statistician. That does not seem to be available in full-text in the searches, but can report after looking through it a second time that they modified the formula to be 3/(n+1) after sensible Bayesian considerations, which tightens up the CI a bit. There is a more recent review in International Statistical Review (2009), 77, 2, 266–275.

Addenda: After looking more closely at the last citation, above I also remember finding the extensive discussion in Agresti & Coull "The American Statistician", Vol. 52, No. 2 (May, 1998), pp. 119-126 informative. The "Agresti-Coull" intervals are incorporated into various SAS and R functions. One R function with it is binom.confint {package:binom} by Sundar Dorai-Raj.

There are several methods for dealing with situations where an accumulation of "zero" observations distort an otherwise nice, tractable distribution of say costs or health-care usage patterns. These include zero-inflated and hurdle models as described by Zeileis in "Regression Models for Count Data in R". Searching Google also demonstrates that Stata and SAS have facilities to handle such models.

After seeing the citation to Browne (and correcting the Jovanovic and Levy modification), I am adding this snippet from the even more entertaining rejoinder to Browne:

"But as the sample size becomes smaller, prior information becomes even more important since there are so few data points to “speak for themselves.” Indeed, small sample sizes provide not only the most compelling opportunity to think hard about the prior, but an obligation to do so. "More generally, we would like to take this opportunity to speak out against the mindless, uncritical use of simple formulas or rules."

• Thank you for the appreciably detailed answer with references. Feb 14 '11 at 2:18
• Jovanovic and Levy recommend 3/(n+1) -- see table 1, page 138 for confirmation. There's also a suggestion by Browne for 3/(n+1.7). faculty.fuqua.duke.edu/~jes9/bio/… May 22 '12 at 15:16
• This is a nice answer. Can you improve the formatting in the 2nd to last paragraph (eg, w/ >)? The quotation marks don't match; is the whole paragraph a quote? Also, the 4th to last paragraph seems to start with a colon for some reason. Dec 8 '13 at 3:44
• Thks. As you suggested. I'm more familiar with the SO formatting. CV is a bit more "literary".
– DWin
Dec 8 '13 at 4:03
• You're welcome. I believe the formatting is the same, except that CV also supports $\LaTeX$ via mathjax. Is the whole paragraph a quote, though (b/c there are unmatched quotation marks w/i)? Dec 8 '13 at 4:05

Thomas Wickens, in his excellent book Multiway Contingency Table Analysis for the Social Sciences, offers a different suggestion from the ones already proposed. He distinguishes between random zeros, "which are accidents of sampling and whose treatment largely consists of adjustments to the degrees of freedom (chapter 5, p. 120, "Empty Cells")," from structural voids or zeros, "which lack a complete factorial structure and whose analysis requires a modification of the concept of independence" (chapter 10, p. 246).

Chapter 10 is titled "Structurally Incomplete Tables" and considers the treatment of data in which certain cells are a priori excluded from consideration. "Examples of this include hospital admissions by gender: although pregnant men may have a cell in the contingency table, none are observed," (p. 247).

Most importantly, "If one treats the impossible cells (structural zeros) as frequencies of zero, they assert themselves as dependencies in a test of independence (p. 246)."

What one wants to do is ignore the impossible cells in any test of independence or association. The way to do this is to estimate the appropriate model on the full contingency table (including the structural zeros) and then subtract the sum of the chi-square values associated with the zero cells from the total chi-square test. This generates a reduced chi-square test of independence only for the reduced contingency table.