Contingency tables — Edexcel A-Level Statistics
Contingency tables explained
Contingency tables covers 3 specification points, including Construct contingency tables from real data,… and Use a χ2 test with the appropriate number of….
Read the full explanation
Open a point below for its explanation and revision guidance.
Construct contingency tables from real data, combining data where appropriate, and interpret results in context.
You build a two-way contingency table from real data by classifying each observation on two categorical variables, for example age band against preferred transport mode. Decide the row and column categories, then tally the joint frequencies into the cells and add row and column totals. Where categories are sparse, combine adjacent or related categories so that expected frequencies are adequate for later analysis, and state clearly which categories you merged. Present the table with informative labels and units. Interpret the pattern in context: compare row or column percentages, identify the largest and smallest cells, and describe association or independence in plain language about the real situation. Note any limitations such as small counts, combined categories or missing data that affect the interpretation.
Use a χ2 test with the appropriate number of degrees of freedom to test for independence in a contingency table and interpret the results of such a test.
A χ2 test for independence asks whether two categorical variables are associated. State H₀: the variables are independent, and H₁: they are not independent. Build the contingency table of observed frequencies O, then compute each expected frequency E = (row total × column total) ÷ grand total. For a table with r rows and c columns, the degrees of freedom are ν = (r − 1)(c − 1); a 3 × 4 table gives ν = 2 × 3 = 6. Calculate X² = Σ (O − E)² ÷ E, compare with the critical value from the χ2 tables at the stated significance level and ν, and interpret in context: if X² exceeds the critical value, reject H₀ and conclude there is evidence of association; otherwise there is insufficient evidence of association. Always report the conclusion in the words of the variables, not just 'reject H₀'.
Know that expected frequencies must be greater than, or equal to, 5 for a χ2 test to be carried out and understand the requirement for combining classes if that is not the case.
Before carrying out a χ2 test, check every expected frequency E. The test requires each E to be at least 5; if any expected frequency is below 5, the χ2 approximation is unreliable. The remedy is to combine classes: merge rows or columns (or categories within a variable) so that the pooled expected frequencies are all at least 5, then recompute the table, the degrees of freedom and the test statistic. For example, if a 3 × 2 table has one cell with E = 3.2, merge that row with an adjacent row to form a 2 × 2 table, giving ν = (2 − 1)(2 − 1) = 1. Combining classes changes the degrees of freedom, so the critical value must be re-read. Report the pooling you performed, since it affects the interpretation.
Your focus
- Construct a correctly labelled contingency table from real data, including totals.
- Combine categories appropriately and record the combinations made.
- Interpret the table in context, describing association and noting limitations.
Show all 9 objectives
- Construct a contingency table of observed frequencies and compute the corresponding expected frequencies.
- Determine the appropriate degrees of freedom and carry out a χ2 test for independence.
- Interpret the outcome of the test in the context of the variables under study.
- Check that all expected frequencies are greater than or equal to 5 before testing.
- Combine classes appropriately when an expected frequency falls below 5.
- Recompute the degrees of freedom and test statistic after combining classes.
Contingency tables exam tips
Marking Points
- Defines two categorical variables and their categories clearly, with a consistent classification rule for each observation.
- Tallies joint frequencies correctly into the cells and includes row and column totals that reconcile with the raw data.
- Combines sparse or related categories where appropriate and states explicitly which categories were merged and why.
- Interprets the table in context using row or column percentages or comparisons of cells, describing the apparent association between the variables.
- Comments on limitations such as small expected counts, merged categories or missing data that affect the strength of the interpretation.
- States H₀ as independence of the two categorical variables and H₁ as association between them, in context.
- Computes expected frequencies as (row total × column total) ÷ grand total for every cell.
- Uses ν = (r − 1)(c − 1) for the contingency table, e.g. ν = 6 for a 3 × 4 table.
- Calculates X² = Σ (O − E)² ÷ E correctly from the observed and expected frequencies.
- Compares the calculated X² with the critical value at the given significance level and ν, and states the decision.
- Interprets the decision in the context of the variables, e.g. evidence of association between the two classifications.
- States that every expected frequency must be greater than or equal to 5 for the χ2 test to be valid.
- Checks the expected frequencies, not the observed frequencies, against the threshold of 5.
- Explains that classes (rows or columns) are combined when an expected frequency is below 5.
- Recomputes the expected frequencies, degrees of freedom and test statistic after combining classes.
- Recognises that pooling changes the degrees of freedom and therefore the critical value used.
Exam tips
- 💡Label both variables and every category, and include totals, so the table is self-contained and easy to mark.
- 💡When you merge categories, write a short note such as 'ages 60 and over combined because of small counts' to justify the decision.
- 💡Support the interpretation with at least one calculated percentage or comparison rather than a general impression.
- 💡Write H₀ and H₁ before any calculation so the interpretation has a clear target.
- 💡Show the expected frequencies in a table alongside the observed frequencies to make the X² sum checkable.
- 💡Quote the critical value, the degrees of freedom and the significance level when stating the decision, then add one contextual sentence.
- 💡Show the expected frequencies explicitly so the check against 5 is visible.
- 💡State which rows or columns you are combining and why, then present the revised table.
- 💡After pooling, restate the new degrees of freedom and the critical value before concluding.
Common Mistakes
- Confusing joint frequencies with marginal totals: cell counts are joint frequencies, while row and column totals are the marginal frequencies, so keep them in separate parts of the table.
- Combining categories without recording the merge: always state which original categories were grouped so the table can be checked against the raw data.
- Interpreting percentages of the grand total when a row or column percentage is needed: choose the base that answers the question being asked.
- Treating an observed association as proof of cause: a contingency table shows association in the data, not causation.
- Using ν = rc − 1 instead of ν = (r − 1)(c − 1); correction: for a contingency table the degrees of freedom are the product of one less than the number of rows and one less than the number of columns.
- Comparing X² with the critical value but reporting only 'reject H₀' without context; correction: state the conclusion in terms of the two variables, e.g. evidence that the variables are associated.
- Dividing by O instead of E in the test statistic; correction: each term is (O − E)² divided by the expected frequency E.
- Checking observed frequencies against 5 instead of expected frequencies; correction: the condition applies to the expected frequencies E.
- Combining classes but keeping the original degrees of freedom; correction: after pooling, recalculate ν = (r − 1)(c − 1) for the reduced table.
- Treating an expected frequency of exactly 5 as unacceptable; correction: the requirement is greater than or equal to 5, so E = 5 satisfies it.