Why Expected Counts Matter
A Pearson chi-square goodness-of-fit test compares observed category counts with the counts predicted by a probability model. Its reference distribution is an approximation, not an automatic consequence of calculating the statistic. When the model predicts very few observations in some categories, the discrete counts can be too uneven for that approximation to give reliable tail probabilities. Checking expected counts is therefore part of deciding whether a reported chi-square p-value is trustworthy.
The check uses the counts predicted under the null model, not the counts that happened to be observed. A category may have an observed count of zero and still be adequately supported if its expected count is large; conversely, an expected count may be too small even when its observed count is not.
The model here is multinomial: each observation belongs to exactly one category, and the category probabilities are specified by the null model. The calculation \(E_i=np_i\) follows because each observation has probability \(p_i\) of being in category \(i\), so the expected value of the total number in that category is the sum of \(n\) indicators, each with expectation \(p_i\). If observations are dependent or the categories do not form an exhaustive partition, this multinomial setup—and the usual goodness-of-fit calculation—may not apply as stated.
Guidelines, Not Mechanical Laws
A familiar conservative guideline is to require every expected count to be at least 5. Another commonly cited guideline, often associated with Cochran, allows no expected count below 1 and no more than 20% of expected counts below 5. These are practical rules of thumb, not mathematical guarantees or universal cutoffs. Different references and applications may use different guidance; a borderline result should be treated as a reason for care rather than as an automatic pass or failure.
For example, a table with one expected count of 4 and nine much larger expected counts is different from a table with half its expected counts below 5, even though both fail the “all at least 5” guideline. The second table has sparse support across many categories. In either case, the test’s modeling assumptions still matter: satisfying a count guideline does not make an incorrect null model or dependent observations acceptable.
The reason for the check is that expected counts are the scale of the random variation in the cells. With small expected counts, the possible observed values are few and the count distribution can be markedly discrete and asymmetric. A continuous chi-square curve may then approximate the relevant tail probabilities poorly. As counts grow, the cell counts are more amenable to the normal approximations underlying Pearson’s chi-square reference distribution. This explains why the check is useful; it does not turn a rule of thumb into a proof for any particular data set.
Confirm that the category probabilities form the multinomial model being tested.
For each category, compute \(E_i=np_i\). Do not substitute \(O_i\).
Compare the smallest values and the number or proportion below 5 with an appropriate guideline.
If counts are sparse, consider defensible pooling or an exact or simulation-based calibration, and state what the chosen method tests.
Worked Examples
Worked Example: Checking a Four-Category Model
A hypothetical study records the selected route, among 120 independent trips, into one of four mutually exclusive route types. Under a specified null model, the probabilities are \(0.50,\ 0.30,\ 0.15,\ 0.05\). The observed counts are \(58,\ 38,\ 18,\ 6\). Assess the expected-count condition and calculate the Pearson statistic. Use the conservative guideline that all expected counts should be at least 5.
Method. First calculate expected counts from the null probabilities and the sample size. The observed and expected totals both equal 120: $$ 58+38+18+6=120,\qquad 120(0.50+0.30+0.15+0.05)=120. $$
The expected counts are $$ E_1=120(0.50)=60,\quad E_2=120(0.30)=36,\quad E_3=120(0.15)=18,\quad E_4=120(0.05)=6. $$ All four are at least 5, so the stated count guideline supports using the chi-square approximation, subject to the other model assumptions.
Now calculate each contribution to the Pearson statistic: $$ X^2=\frac{(58-60)^2}{60}+\frac{(38-36)^2}{36} +\frac{(18-18)^2}{18}+\frac{(6-6)^2}{6} =\frac{4}{60}+\frac{4}{36}+0+0 =0.1778. $$
The statistic is \(0.1778\) to four decimal places. The expected counts sum to 120, as they should. The common mistake this method avoids is checking the observed values instead: the observed count of 6 in the last category is not the reason the approximation is supported; its expected count of 6 is.
Worked Example: Pooling Two Related Categories
A hypothetical survey classifies 80 independent devices by their recorded operating mode. A specified null model assigns probabilities \(0.50,\ 0.30,\ 0.15,\ 0.05\) to four distinct modes. The observed counts are \(41,\ 23,\ 12,\ 4\). The last two modes are adjacent levels of the same ordered operating scale, and the investigation is willing to test their combined frequency rather than their separate frequencies. Apply the all-at-least-5 guideline and assess whether pooling those two modes is defensible.
Method. Calculate the original expected counts: $$ 80(0.50)=40,\quad 80(0.30)=24,\quad 80(0.15)=12,\quad 80(0.05)=4. $$ The fourth expected count is below 5. Thus, the original four-category table does not meet the stated conservative guideline.
Because the two adjacent modes can be meaningfully treated as one combined category for this study, add both their observed counts and their null probabilities: $$ O_{\text{combined}}=12+4=16,\qquad p_{\text{combined}}=0.15+0.05=0.20. $$ The pooled expected count is \(80(0.20)=16\), so the three expected counts are \(40,\ 24,\ 16\). Each is at least 5. The pooled observations are \(41,\ 23,\ 16\), which also sum to 80.
For the pooled categories, the Pearson statistic is $$ X^2=\frac{(41-40)^2}{40}+\frac{(23-24)^2}{24}+\frac{(16-16)^2}{16} =\frac{1}{40}+\frac{1}{24}+0 =0.0667. $$ The result is \(0.0667\) to four decimal places. Pooling is defensible here because the two categories have a meaningful combined interpretation and the study’s question permits that aggregation. The pooled test does not assess whether the two modes separately follow their original probabilities; it tests the grouped distribution. Do not merge categories solely because their observed counts are inconvenient.
Worked Example: Using an Exact Multinomial Test for Sparse Counts
In a hypothetical experiment, four independent trials each produce one of three outcomes. Under the fully specified null model, the probabilities are \(0.50,\ 0.25,\ 0.25\). The observed counts are \((4,0,0)\). Use the Pearson statistic to order outcomes and calculate an exact upper-tail p-value, defined as the null probability of all count vectors whose Pearson statistic is at least the observed value.
Method. The expected counts are $$ E_1=4(0.50)=2,\qquad E_2=4(0.25)=1,\qquad E_3=4(0.25)=1. $$ These are sparse, so an asymptotic chi-square p-value is not justified by the expected-count guidelines. The observed statistic is $$ X^2_{\text{obs}}=\frac{(4-2)^2}{2}+\frac{(0-1)^2}{1}+\frac{(0-1)^2}{1} =2+1+1=4. $$
For any count vector \((x_1,x_2,x_3)\) summing to 4, its Pearson statistic simplifies to $$ X^2=\frac{x_1^2}{2}+x_2^2+x_3^2-4. $$ Enumerating the possible count vectors, the vectors with \(X^2\geq4\) are \((4,0,0)\), \((1,3,0)\), \((1,0,3)\), \((0,4,0)\), \((0,3,1)\), \((0,2,2)\), \((0,1,3)\), and \((0,0,4)\). Under the null model, the probability of a vector is its multinomial probability, $$ P(x_1,x_2,x_3)=\frac{4!}{x_1!x_2!x_3!}(0.50)^{x_1}(0.25)^{x_2}(0.25)^{x_3}. $$ Summing the probabilities of the listed vectors gives $$ P(X^2\geq4) =\frac{16+8+8+1+4+6+4+1}{256} =\frac{48}{256} =0.1875. $$ Thus, the exact upper-tail p-value under this stated ordering is \(0.1875\). For example, at significance level \(0.05\), this exact test would not reject the null model. The common mistake to avoid is using a chi-square reference distribution just because the Pearson statistic can be calculated; here, its expected counts are only 2, 1, and 1.
Pooling, Exact Methods, and Interpretation
Pooling changes the categories and therefore changes the question. If categories \(i\) and \(j\) are combined, the new observed count is \(O_i+O_j\), and the new expected count is \(n(p_i+p_j)=E_i+E_j\). The combined count can be appropriate when the categories are naturally related and the scientific or operational question concerns their total. It is not appropriate merely because a particular observed count is small, nor should the choice be driven by which grouping produces a preferred p-value. Whenever possible, decide on meaningful groupings before examining the observed counts.
When pooling would discard important distinctions or would not make sense, a test calibrated to the finite-sample null distribution may be preferable. For a fully specified multinomial model, an exact test can enumerate all possible count vectors and sum probabilities for outcomes at least as extreme under a stated ordering. As the worked example illustrates, the ordering must be defined; an exact p-value is not simply the probability of observing the one count vector in the data. For larger problems, simulation under the null can approximate this calibration. If model parameters are fitted from the data, the calibration must account for that fitting procedure; an exact calculation based on fixed probabilities may not be exact for the fitted-parameter problem.
The degrees of freedom and expected-count adequacy answer different questions. The degrees of freedom describe the reference distribution used for a goodness-of-fit test, including adjustments when parameters are fitted. Expected-count checks assess whether a chi-square approximation is plausible in the first place. A correct degrees-of-freedom calculation cannot repair sparse expected counts, just as adequate expected counts cannot repair an incorrectly specified reference distribution.
Check Your Understanding
For each situation, decide what the expected counts imply about the proposed chi-square approximation or alternative.
- A hypothetical sample of 200 items is classified into four categories with null probabilities \(0.40,\ 0.30,\ 0.20,\ 0.10\). Find the expected counts and assess the all-at-least-5 guideline. (Answer: \(80,\ 60,\ 40,\ 20\); all meet the guideline.)
- A hypothetical study has \(n=50\) and four null probabilities \(0.70,\ 0.20,\ 0.08,\ 0.02\). Assess the all-at-least-5 and the guideline allowing no more than 20% below 5 and none below 1. (Answer: Expected counts \(35,\ 10,\ 4,\ 1\); the all-at-least-5 rule fails, and 2 of 4 counts are below 5, so the 20% guideline also fails; none is below 1.)
- A hypothetical sample has \(n=90\), with null probabilities \(0.50,\ 0.25,\ 0.15,\ 0.10\). Calculate the expected counts and state whether they meet the all-at-least-5 guideline. (Answer: \(45,\ 22.5,\ 13.5,\ 9\); yes, every expected count is at least 5.)
- A hypothetical sample of 40 has null probabilities \(0.60,\ 0.25,\ 0.10,\ 0.05\) and observed counts \(23,\ 11,\ 4,\ 2\). If the last two categories are meaningfully combined and the study question permits it, find the pooled expected counts and determine whether they all meet 5. (Answer: Original expected counts are \(24,\ 10,\ 4,\ 2\); after pooling, the expected counts are \(24,\ 10,\ 6\), all at least 5.)
- A hypothetical experiment has \(n=10\) and three null probabilities \(0.80,\ 0.10,\ 0.10\). The two rare outcomes must remain distinct for the study question. Calculate the expected counts and choose between relying on the usual chi-square approximation and seeking an exact or simulation-based calibration. (Answer: Expected counts \(8,\ 1,\ 1\); because pooling is not appropriate and two expected counts are sparse, seek an exact or simulation-based calibration rather than relying on the usual chi-square approximation.)