Carrying Out a Two-Way Chi-Square Test
Compute the statistic
- The chi-square statistic is the same sum over every cell of the table:
-
$$\chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}}$$
- Use each cell's observed count and its expected count from 8.4.
- Add all the cell terms into one $\chi^2$.
Find the p-value
- Use the chi-square distribution with $df = (\text{rows}-1)(\text{columns}-1)$.
- The p-value is the right-tail area beyond your $\chi^2$.
- A large $\chi^2$ → small p-value → strong evidence against $H_0$.
- Get the correct $df$ from the table's shape, not the sample size.
Make a decision
- Compare the p-value to $\alpha$:
- p $\le \alpha$ → reject $H_0$; p $> \alpha$ → fail to reject.
- Reject: the groups differ (homogeneity) or the variables are associated (independence).
- Fail to reject: not convincing evidence of a difference/association.
Conclude in context
- For homogeneity: "convincing evidence the distributions differ across the groups" (if rejected).
- For independence: "convincing evidence the two variables are associated" (if rejected).
- Name the variables/groups and the actual context.
- Failing to reject never proves the groups are the same / variables independent.
Word the conclusion to match the test. Reject in a homogeneity test → the group distributions differ; reject in an independence test → the variables are associated. Don't say "the variables are related" for a homogeneity design, or "the groups differ" for an independence design — the math is shared but the claim is not.
A $2\times2$ independence test gives $\chi^2 = 6.0$, $df = 1$, $\alpha = 0.05$.
- p-value: right-tail area beyond $6.0$ at $df=1 \approx 0.014$.
- Decide: $0.014 \le 0.05$ → reject $H_0$.
- Conclude: convincing evidence the two variables are associated (in context).
Compute $\chi^2 = \sum \frac{(\text{observed}-\text{expected})^2}{\text{expected}}$ over all cells, find the right-tail p-value at $df = (\text{rows}-1)(\text{columns}-1)$, and compare to $\alpha$. Word the conclusion to match the design: distributions differ (homogeneity) or variables associated (independence), in context.
The right-tailed chi-square area
The p-value is the right-tail area at df = (r−1)(c−1).
With χ² = 6.0 at df = 1, the p-value ≈ 0.014. At α = 0.05, the decision is...
0.014 ≤ 0.05 → reject H0.
Rejecting H0 in a test of INDEPENDENCE means...
Independence: reject → the variables are associated.
Rejecting H0 in a test of HOMOGENEITY means...
Homogeneity: reject → the group distributions differ.
The p-value for a two-way chi-square test is a right-tail area.
Chi-square is always right-tailed.
For a 3×4 two-way table, find the degrees of freedom (r−1)(c−1).
(3−1)(4−1) = 2×3 = 6.