Why Read the Cells After Testing the Table?
A chi-square test for independence or homogeneity summarizes departures across an entire two-way table. A small p-value indicates that the table as a whole differs from the pattern expected under the null hypothesis, but it does not say which combinations of categories contribute most to that difference. Cell residuals help describe the shape of the departure: which cells contain more observations than expected, which contain fewer, and how large those departures are relative to their scale.
This is a descriptive diagnostic step. Residuals can suggest a pattern worth explaining, but they do not by themselves establish that a particular cell is statistically significant. The cells share row and column totals, so their departures are related; treating each cell as an independent test would overstate the evidence.
Reading a Cell Residual
The expected count is based on the table margins:
Under the null hypothesis of independence, this is the count predicted by combining the row and column proportions. In a homogeneity study, the corresponding null prediction is that the category distribution is the same across groups. In either setting, a residual compares an observed cell with its null expectation.
A raw difference of 5 observations does not have the same scale in every cell. For example, a difference of 5 relative to an expected count of 10 is more pronounced than a difference of 5 relative to an expected count of 100. Dividing by \(\sqrt{E_{ij}}\) accounts partly for this scale difference. A larger absolute Pearson residual indicates a larger departure relative to that cell’s expected-count scale, not a larger causal effect.
Terminology varies across sources: “standardized residual” may refer to the Pearson residual, or to an adjusted version that also accounts for estimating row and column proportions. One common adjusted standardized residual is
where \(R_i\) and \(C_j\) are the row and column totals and \(N\) is the grand total. The denominator differs, so values from the two definitions are not interchangeable. Always check which residual a table or software output reports. The examples below use Pearson residuals.
Worked Example: Finding the Direction of a Departure
Suppose, hypothetically, that 80 randomly selected participants are classified by program group and preferred appointment time. The observed counts are shown below. Assume each participant contributes to exactly one cell, the observations are independent, and the expected counts are adequate for the Pearson chi-square approximation.
| Group | Morning | Afternoon | Evening | Total |
|---|---|---|---|---|
| A | 20 | 10 | 10 | 40 |
| B | 10 | 20 | 10 | 40 |
| Total | 30 | 30 | 20 | 80 |
Under independence, the expected count for Group A and Morning is
The Pearson residual in that cell is
The positive sign means Group A has 5 more morning preferences than expected under independence. For Group A and Afternoon, the expected count is also \(40(30)/80=15\), so its residual is \((10-15)/\sqrt{15}=-1.291\): fewer afternoon preferences than expected. The evening count in Group A is exactly its expected count, \(40(20)/80=10\), giving residual 0. Group B has the opposite pattern in the first two columns. The signs describe the direction of the departures, not their cause.
How Cell Patterns Relate to the Overall Statistic
Each Pearson residual squared is exactly the contribution of its cell to the Pearson chi-square statistic:
This identity explains why cells with larger absolute residuals contribute more to the overall statistic. Squaring removes the sign, however. The statistic measures the total discrepancy, while the signed residuals are needed to explain whether counts are above or below expectation.
The table margins also constrain the pattern. Because expected counts and observed counts have the same row and column totals, the signed count departures balance within every row and column:
Thus a positive departure somewhere must be balanced by negative departures elsewhere in the same row and column. Residuals are not independent pieces of evidence. A pattern across several cells is often more informative descriptively than reading one cell in isolation.
Worked Example: A Visible Pattern With a Modest Overall Test
Return to the hypothetical table above. Its expected counts are 15, 15, and 10 in each row, so all expected counts are at least 5. The Pearson residuals are \(1.291,-1.291,0\) for Group A and \(-1.291,1.291,0\) for Group B. The repeated signs show a reciprocal pattern: morning is above expectation for A and below for B, while afternoon shows the reverse.
The overall statistic is found by summing the six squared residuals, or equivalently the cell contributions:
There are \((2-1)(3-1)=2\) degrees of freedom. The upper-tail p-value is approximately \(P(\chi^2_2\ge 6.667)=0.0357\). At significance level \(0.05\), this is evidence against independence for the table as a whole. The pattern helps describe that evidence, but it does not make each of the four nonzero cells a separately established finding. Cell-by-cell inference requires appropriate attention to the fact that many cells may be examined.
Comparing Residual Patterns Carefully
Residual magnitude is useful for spotting which cells contribute most, but context matters. First, identify the residual definition and compare like with like. Second, consider the whole table: an isolated positive value may be paired with negative departures that balance its margins. Third, consider whether the apparent pattern is coherent across categories. A run of positive residuals in one row, or an orderly shift from positive to negative across ordered categories, may communicate the table’s structure better than a list of the largest values.
Large absolute residuals are sometimes treated as a quick flag for closer inspection, but a cutoff such as 2 is only a rough descriptive convention when many cells are inspected. It is not automatically a valid cell-level significance test. Under the null, standardized residuals may have an approximately normal distribution in suitable large-sample settings, but their dependence and the number of examined cells still matter. Do not turn an exploratory threshold into a formal conclusion.
Worked Example: A Strong, Ordered Pattern Across Categories
Imagine a hypothetical survey of 180 people, classified by one of three training levels and one of three satisfaction categories. The table has 60 people in each row and 60 in each column. Each expected count is therefore \(60(60)/180=20\). Suppose the observed counts are:
| Training level | Low satisfaction | Moderate satisfaction | High satisfaction | Total |
|---|---|---|---|---|
| Basic | 30 | 20 | 10 | 60 |
| Intermediate | 20 | 20 | 20 | 60 |
| Advanced | 10 | 20 | 30 | 60 |
| Total | 60 | 60 | 60 | 180 |
For Basic training and Low satisfaction,
For Basic and High satisfaction, the residual is \((10-20)/\sqrt{20}=-2.236\). The Intermediate row has three zero residuals. In the Advanced row the signs reverse: Low has \(-2.236\), Moderate has 0, and High has \(2.236\). Descriptively, the table shows opposite end-to-end patterns in the Basic and Advanced rows, with the Intermediate row matching expectation.
There are four nonzero cells, each contributing \(10^2/20=5\); the other five cells contribute zero. Hence
The upper-tail p-value is approximately 0.000499. Since all expected counts equal 20, the usual expected-count condition is met; with independent observations and one classification per person, the overall Pearson test provides strong evidence against independence. The residual pattern describes where the discrepancy lies, but this survey alone does not show that training level caused satisfaction to differ.
Why the Distinction Matters
An overall test and a residual display answer related but different questions. The test evaluates the global null hypothesis for the table. Residuals help explain the observed departure and can guide follow-up questions. A large overall statistic may arise from several moderate departures or a few concentrated ones. Conversely, a table can contain visually noticeable positive and negative residuals without enough total evidence to reject the global null.
Keep three statements distinct: “this cell is above its expected count” is a direct descriptive statement; “the table provides evidence against independence” is an overall inferential conclusion based on the test; and “this particular cell differs significantly” is a cell-level inferential claim that requires a suitable procedure accounting for multiple comparisons. The last claim does not follow automatically from the first two.
Common Mistake
Wrong reasoning: “This cell has a positive residual, so the categories are significantly associated in this cell.” A positive residual only states that the observed count exceeds its null expectation. It does not, on its own, quantify a cell-specific p-value or account for examining many cells.
Correction: State the descriptive direction and magnitude first, then report the overall test separately. For example: “The observed count in this cell was above its expected count; the omnibus chi-square test provides evidence of an association across the table.” Reserve cell-specific significance claims for an appropriate follow-up analysis.
Check Your Understanding
Use the definitions and examples above to answer these questions.
- A cell has \(O_{ij}=18\) and \(E_{ij}=12\). What is the sign of its Pearson residual, and what does that sign mean?
- Why can a difference of 5 observations be more notable in a cell with expected count 10 than in one with expected count 100?
- Explain why the Pearson chi-square statistic does not retain the direction of cell departures.
- A table has several large residuals, but its overall test is not significant at the chosen level. Why should those residuals not be reported as individually significant findings?
- What is the difference between saying a cell is above expectation and concluding that the table provides evidence against independence?