Premium Writing, Design & Advisory · Dubai, UAE

Chi-square tests for contingency tables: how to interpret the result and inspect cells

Use Pearson’s chi-square test of independence to assess whether two categorical variables are associated in a table of independent observations. Compare observed counts with the counts expected under independence. If the overall result suggests association, inspect cell contributions and group percentages to understand where the departure occurs. Report its strength and limitations alongside the test.

Nine-compartment ceramic tray with unevenly distributed beads and one empty compartment

Check what each count represents

Each unit should contribute to one cell. If each person makes one selection, the table can compare their response categories across groups. If one person responds several times or can select multiple options, entries may be dependent. A standard Pearson test then does not account for the data structure. Start with the study design and choose a method that represents pairing, repeated measurements, clustering or survey weights where applicable.

Use counts for the calculation and percentages to help comparison. Report what the percentages are conditional on. Row percentages answer how responses are distributed within each row group. Column percentages answer how the groups are represented among people with a particular response. They can tell different stories from the same table.

Work through a three-by-three example

Imagine a fictional study in which 120 learners, drawn independently from three course streams, each choose one preferred type of assessment support. All three choices are available to all learners. The counts are illustrative.

StreamWritten guideLive workshopRecorded demoTotal
A16121240
B248840
C2020040
Total604020120

Under independence the expected count in a cell is its row total multiplied by its column total and divided by 120. Because each stream has 40 learners, the expected counts are the same in every row: 20, 13⅓ and 6⅔. The zero in stream C is an observed zero. Learners in that stream could have selected a recorded demo. If the option had been unavailable by design, the table and reference model would need to represent that structural restriction.

For each cell, square the observed-minus-expected difference and divide it by the expected count. Keep full precision until the final step. The nine contributions sum to 18.4, with four degrees of freedom for this complete three-by-three table. The approximate p value is 0.00103 under the Pearson chi-square reference distribution. See the NIST contingency-table procedure for the expected-count formula and degrees of freedom.

Show where the overall departure occurs

Compare the observed and expected counts and inspect the direction of the differences. The recorded-demo cell for stream C contributes 6⅔ to the overall statistic. Its Pearson residual is approximately −2.58, calculated by dividing 0 minus 6⅔ by the square root of 6⅔. A residual's sign is informative. The squared contribution used by the global statistic has no direction.

Report row percentages to make the difference interpretable. Stream C’s 50% preference for a live workshop exceeds A’s 30% and B’s 20%. This is descriptive. It is not proof that stream C differs from each of the other streams on a separate test. If making cell-level claims, prespecify or clearly label follow-up questions. Use an appropriate residual or contrast method and account for multiple comparisons. Haberman’s residual analysis discusses residuals in cross-classified tables, including adjusted residuals whose denominators account for the estimated margins.

Calculate a follow-up residual using the margins

For the recorded-demo cell in stream C, the expected count is 6⅔, the row accounts for 40/120 of the sample and the column accounts for 20/120. Under the independence model, the adjusted residual divides the observed minus expected count by the square root of the expected count multiplied by (1 − row proportion) and (1 − column proportion). Here the denominator is about 1.92, giving an adjusted residual of about −3.46. The negative sign shows that the stream supplied fewer recorded-demo choices than expected.

Use this calculation to locate a departure from independence. It does not compare stream C directly with stream A or B. If you plan to make a claim about a specific pair, define that comparison and account for the other comparisons being made. If the cell was selected after inspecting the full table, say so and treat the follow-up as exploratory.

Check sparse counts and quantify strength

The large-sample reference distribution can be unreliable with sparse expected counts. Inspect the expected table and the sampling design. Consider an exact or Monte Carlo procedure supported for the table and null hypothesis. Combine categories only when their combined meaning answers a defensible question. Record any decision to collapse categories and avoid doing so solely to change the result.

Use an association measure and show what the distributions look like. Cramér’s V divides the Pearson statistic by the sample size times the smaller of the row or column degrees of freedom, then takes the square root. In this case, the calculation is √(18.4 ÷ 240), about 0.277. It is an overall measure without a positive or negative direction. Explain the importance of the observed patterns in the study context rather than treating a universal cutoff as decisive.

Report the scope of the finding

For the fictional example: support preference varied across streams in the Pearson test, χ²(4, N = 120) = 18.40, p = 0.00103, Cramér’s V = 0.277. Show the table and the expected-count check, name any follow-up analyses and explain what the design permits. The association by itself does not show that enrolment in a stream changed a learner’s preference.

For feedback on categorical data, follow-up contrasts or reporting, see research data analysis support, Talk to Labeeb or send a project enquiry. You remain responsible for the data, analysis and authorship.

Sources

NIST Engineering Statistics Handbook, contingency-table comparison · Haberman (1973), residuals in cross-classified tables.

Talk to LabeebMon–Sat, 9 AM–9 PM Dubai time. Closed Sunday.