How do you compute the chi-square statistic and P-value and conclude a test of homogeneity or independence?
Topic 8.6 Carrying Out a Chi-Square Test for Homogeneity or Independence: compute the chi-square statistic from a two-way table, find the P-value using (rows minus 1)(columns minus 1) degrees of freedom, and state a conclusion in context.
A focused answer to AP Statistics Topic 8.6, on computing the chi-square statistic from a two-way table, finding the P-value with (r minus 1)(c minus 1) degrees of freedom, and stating a conclusion in context, with a full worked test.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this topic is asking
The College Board (Topic 8.6) wants you to carry out and conclude a chi-square test of homogeneity or independence: compute the chi-square statistic from the two-way table, find the P-value with degrees of freedom, compare to , and state a conclusion in context.
The statistic and degrees of freedom
The statistic is the same as goodness of fit, now summed over every cell of the table. The only computational difference from the one-variable test is the degrees of freedom: instead of . For a table, ; for a table, . As before, the chi-square distribution is right-skewed, so the P-value is the upper tail only, never doubled.
From statistic to conclusion
The decision rule is standard; the conclusion wording follows the design. For homogeneity, conclude about the distribution differing across groups ("there is convincing evidence the distribution of preference differs among the regions"). For independence, conclude about an association between two variables ("there is convincing evidence that exercise habit and sleep quality are associated"). Matching the conclusion to the test type is graded, and a homogeneity conclusion phrased as "associated" (or vice versa) loses the contextual mark.
What a significant result does and does not say
A rejected test says the distributions differ (or the variables are associated) somewhere in the table, but does not say which cells or how. To discuss where the effect lies, inspect the individual cell contributions : the largest terms identify the cells driving the result. And, as always, a chi-square test of independence shows association, not causation; only a randomised experiment supports a causal claim. Likewise, a non-significant result does not prove the distributions are identical or the variables independent, it only fails to find evidence against the null. Reporting these limits is part of a complete answer.
Try this
Q1. A table is tested. Find the degrees of freedom. [1 point]
- Cue. .
Q2. A test of independence is significant. State two things it does NOT establish. [2 points]
- Cue. It does not establish causation (association is not causation), and it does not identify which specific cells differ (inspect the largest contributions for that).
Exam-style practice questions
Practice questions written in the style of College Board exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AP 2018 (style)1 marksSection I (multiple choice). A two-way table has rows and columns. The chi-square degrees of freedom are (A) (B) (C) (D) Show worked answer →
The correct answer is (C).
For a two-way table, .
(A) is rows times columns. (B) is rows plus columns. (D) is the total cells minus one. The correct value is .
AP 2022 (style)4 marksSection II (free response). A single random sample of adults is classified by exercise habit (regular/irregular) and sleep quality (good/poor). Observed: regular and good , regular and poor , irregular and good , irregular and poor . Test at whether exercise habit and sleep quality are associated. Compute the chi-square statistic and P-value (use ), and conclude in context (justify in context).Show worked answer →
A 4-point test of independence.
(1) (1 point) : exercise habit and sleep quality are independent; : they are associated. One random sample; expected counts checked .
(2) (1 point) Row totals: regular , irregular ; column totals: good , poor ; grand total . Expected: regular-good , regular-poor , irregular-good , irregular-poor . All .
(3) (1 point) , . P-value .
(4) (1 point) Since P-value , reject . There is convincing evidence that exercise habit and sleep quality are associated.
Markers reward expected counts, the chi-square sum, , the P-value, and a contextual conclusion.
Related dot points
- Topic 8.5 Setting Up a Chi-Square Test for Homogeneity or Independence: distinguish a test of homogeneity from a test of independence based on the design, state the appropriate hypotheses, and check the conditions.
A focused answer to AP Statistics Topic 8.5, on distinguishing a chi-square test of homogeneity (several groups, same variable) from a test of independence (one sample, two variables), stating the right hypotheses, and checking the conditions.
- Topic 8.4 Expected Counts in Two-Way Tables: compute the expected count for each cell of a two-way table under the null hypothesis using the row total times column total divided by the grand total.
A focused answer to AP Statistics Topic 8.4, on computing expected counts in a two-way table under the null of no association, using row total times column total over the grand total, and why this formula encodes independence.
- Topic 8.3 Carrying Out a Chi-Square Test for Goodness of Fit: compute the chi-square statistic from observed and expected counts, find the P-value using k minus 1 degrees of freedom, and state a conclusion in context.
A focused answer to AP Statistics Topic 8.3, on computing the chi-square statistic from observed and expected counts, finding the P-value with k minus 1 degrees of freedom, and stating a conclusion in context, with a full worked test.
- Topic 8.7 Skills Focus: Selecting an Appropriate Inference Procedure for Categorical Data: choose among the one-proportion, two-proportion, and chi-square (goodness of fit, homogeneity, independence) procedures based on the scenario.
A focused answer to AP Statistics Topic 8.7, on choosing among one-proportion, two-proportion, and chi-square (goodness of fit, homogeneity, independence) procedures for categorical data, based on the number of variables, categories, and samples, with a worked decision.
- Topic 2.3 Statistics for Two Categorical Variables: calculate joint, marginal, and conditional relative frequencies from a two-way table, and use conditional distributions to judge association.
A focused answer to AP Statistics Topic 2.3, on joint, marginal, and conditional relative frequencies from two-way tables, and using conditional distributions to assess association, with full worked proportion calculations.
Sources & how we know this
- AP Statistics Course and Exam Description — College Board (2020)