Why Standardize Cell Residuals?
A Pearson residual shows how far a cell’s observed count is from its expected count, measured in units of the square root of that expected count. But cells in a two-way table share row and column totals. Those fixed or estimated margins constrain how much a cell count can vary. An adjusted standardized residual takes this into account, giving a more suitable approximate standard-normal scale for diagnosing individual cells.
The aim is to see which cells depart most from the independence model: which have notably more observations than expected, and which have notably fewer. This is a cell-level diagnostic. It complements the overall Pearson chi-square test, but it does not replace that test or remove the need to consider the table’s sampling conditions.
The expected count under independence is \(E_{ij}=R_iC_j/N\). Thus the two proportions in the denominator are the share of all observations in the cell’s row and the share in its column. The numerator is the cell’s observed-minus-expected difference. The denominator estimates the standard deviation of that difference after accounting for both margins.
What the Adjusted Residual Tells You
A positive adjusted residual means \(O_{ij}>E_{ij}\): that cell contains more observations than the independence model predicts. A negative value means fewer. The absolute value describes how many adjusted standard-error units the observed count lies from its expected count. For example, an adjusted residual of \(2.4\) means the observed count is 2.4 estimated standard errors above its expected count.
Under the null model of independence, adjusted standardized residuals are approximately standard normal when the table is sufficiently large and the usual chi-square conditions are met. This makes values near zero unsurprising; larger absolute values are more unusual under independence. The approximation is not exact, and the residuals in a table are not independent of one another. Therefore, a large residual is a diagnostic signal, not by itself a definitive cell-specific test.
Worked Example: A Two-by-Two Table
Suppose a hypothetical survey records whether 200 people in two groups prefer a new menu item. The counts are shown below.
| Group | Prefer | Do not prefer | Total |
|---|---|---|---|
| A | 50 | 50 | 100 |
| B | 30 | 70 | 100 |
| Total | 80 | 120 | 200 |
Assume the observations are independent and the counts meet the conditions for chi-square inference. Under independence, the expected count for Group A and “Prefer” is
The row proportion is \(100/200=0.50\), and the column proportion is \(80/200=0.40\). Therefore,
The observed count in this cell is about 2.9 adjusted standard errors above its expected count. In context, the survey has more Group A respondents who prefer the item than the independence model predicts. This residual alone does not establish that the groups differ; it identifies a cell contributing a notable departure that merits interpretation alongside the overall analysis.
For comparison, the expected count in the “Group A, Do not prefer” cell is \(100(120)/200=60\). Its adjusted residual is
The negative sign indicates fewer Group A respondents in that cell than expected. The two residuals are related: a row total constrains the counts in that row, so one should not treat cell residuals as independent pieces of evidence.
Why the Denominator Includes Both Margins
The Pearson residual is \((O_{ij}-E_{ij})/\sqrt{E_{ij}}\). The adjusted residual changes its scale because the variation in a cell count is reduced when its row and column totals are taken into account. A short variance calculation explains the adjustment.
Under independence, if the row and column margins are fixed, the count \(O_{ij}\) has a hypergeometric distribution: among \(N\) observations, \(R_i\) belong to row \(i\), and \(C_j\) positions belong to column \(j\). Its mean is \(R_iC_j/N=E_{ij}\). The variance of a hypergeometric count is the number of draws times the success proportion, the failure proportion, and the finite-population correction. Here that gives
The factor \(N/(N-1)\) is a finite-sample correction that approaches 1 as \(N\) grows. Dropping this small factor gives the variance estimate in the adjusted residual’s denominator squared. Dividing the observed-minus-expected difference by that estimated standard deviation produces the usual adjusted standardized residual. For sufficiently large counts, the standardized difference is approximately standard normal. When margins arise from sampling rather than being fixed by design, the same formula is used as an approximate large-sample diagnostic under the independence model.
Worked Example: Comparing Cells in a Three-by-Two Table
In a hypothetical survey, 240 people from three groups choose between two options. Each row total is 80, and each column total is 120. The observed counts are:
| Group | Option 1 | Option 2 | Total |
|---|---|---|---|
| A | 50 | 30 | 80 |
| B | 40 | 40 | 80 |
| C | 30 | 50 | 80 |
| Total | 120 | 120 | 240 |
For every cell, the independence-model expected count is \(80(120)/240=40\). The row proportion is \(80/240=1/3\), and each column proportion is \(120/240=1/2\). For Group A choosing Option 1,
The count of 50 is above its expected value of 40, with a residual about 2.7 adjusted standard errors above zero. For Group A choosing Option 2, the difference is \(30-40=-10\), so the adjusted residual is \(-2.739\). Group B has observed counts equal to both expected counts, so its two adjusted residuals are zero. Group C has residuals \(-2.739\) for Option 1 and \(2.739\) for Option 2.
This calculation illustrates that equal observed-minus-expected differences need not always yield equal adjusted residuals in tables with unequal margins. Here the margins are balanced, so the denominators match across cells. In a table with different row or column proportions, the adjustment can change the relative magnitudes.
Calculating Residuals Systematically
For a full table, work cell by cell. First calculate the expected count from its row and column totals. Then calculate the adjusted denominator using those same margins, and divide the observed-minus-expected difference by it. Retain the sign: it carries the direction of the departure. A compact table of results can make the cells with the largest absolute residuals easy to identify.
Worked Example: Unequal Margins
Consider a hypothetical table of 300 observations, with row totals 120, 100, and 80, and column totals 90, 120, and 90. The observed counts are shown below.
| Group | Category 1 | Category 2 | Category 3 | Total |
|---|---|---|---|---|
| A | 50 | 45 | 25 | 120 |
| B | 25 | 40 | 35 | 100 |
| C | 15 | 35 | 30 | 80 |
| Total | 90 | 120 | 90 | 300 |
For Group A and Category 1, the expected count is \(120(90)/300=36\). The row proportion is \(0.40\), and the column proportion is \(0.30\). Thus,
The same procedure gives the following residuals. For instance, Group A and Category 3 has expected count \(120(90)/300=36\), giving \((25-36)/\sqrt{36(0.60)(0.70)}\approx -2.829\). The table reports residuals rounded to three decimal places.
| Group | Category 1 | Category 2 | Category 3 |
|---|---|---|---|
| A | 3.600 | -0.722 | -2.829 |
| B | -1.336 | 0.000 | 1.336 |
| C | -2.564 | 0.800 | 1.709 |
For Group C and Category 1, for example, the expected count is \(80(90)/300=24\). The denominator is \(\sqrt{24(1-80/300)(1-90/300)}=\sqrt{12.32}\), and the residual is \((15-24)/\sqrt{12.32}\approx-2.564\). Its negative sign indicates a lower count than expected. Group A and Category 1 has the largest absolute residual in this table, so it is the cell with the strongest standardized departure from its expected count in this diagnostic.
Using the Approximate Normal Scale Carefully
Because the adjusted residual is approximately standard normal under independence, it can be compared with familiar standard-normal reference values. A value around 0 is close to expectation; a value near 2 or \(-2\) is more unusual under the model; and a larger absolute value is a stronger signal of departure. These comparisons are approximate and should be interpreted with the study design and cell counts in mind.
In particular, scanning many cells makes it more likely that at least one residual will be large by chance. Cell residuals are also dependent because the margins constrain the table. Therefore, do not read each residual as a separate, unadjusted hypothesis test or conclude that a cell is definitively significant solely from its magnitude. Use residuals to diagnose where the overall discrepancy may be concentrated, and report the observed and expected counts with the direction of the difference.
Adjusted residuals also differ from Pearson cell contributions. A Pearson cell contribution is \((O_{ij}-E_{ij})^2/E_{ij}\), a nonnegative part of the overall Pearson chi-square statistic. The adjusted residual is signed and uses an adjusted denominator. Its square is therefore not generally the Pearson contribution, and adjusted residuals should not be squared and summed to reconstruct the Pearson chi-square statistic.
Common Mistakes
- Using only the expected count in the denominator. That gives a Pearson residual, not an adjusted standardized residual. Include both margin factors, \(1-R_i/N\) and \(1-C_j/N\).
- Discarding the sign. The absolute value describes magnitude, but the sign distinguishes more observations than expected from fewer.
- Calling a large residual proof of association in that cell. The normal scale is approximate, and inspecting many cells raises the chance of seeing a large value. Treat it as a diagnostic, not a stand-alone conclusion.
- Assuming adjusted residuals sum to the Pearson chi-square statistic. The overall statistic is the sum of Pearson cell contributions; adjusted residuals use a different denominator.
Check Your Understanding
Try these questions without looking back.
- In a two-way table, a cell has observed count 28 and expected count 20. What does the sign of its adjusted standardized residual tell you?
- Which two margin proportions appear in the adjusted residual’s denominator?
- A cell has adjusted standardized residual \(-2.5\). Interpret its sign and magnitude in context, without claiming that the null hypothesis is false.
- Why is an adjusted residual not generally interchangeable with a Pearson cell contribution?
- Why should a large residual found while scanning many cells be treated cautiously?