Statistics › Section K · The chi-square distribution › Topic K.5

Choosing the right chi-square test

Three tests share one statistic: the same formula, the same degrees-of-freedom logic, the same right tail. What differs is the design that produced the counts - and the design, read honestly, names its test.

One statistic, three tests

Goodness-of-fit, independence, homogeneity: three tests, one \(\chi^2 = \sum (O-E)^2/E\), one right tail, one family of curves. The differences live entirely in the design - how the counts were gathered and what the null claims about them. Learning the three as one machine with three intake valves is easier and more durable than memorising three procedures: read the design, build the expected counts, run the sum, read the tail.

The decision guide

Ask two questions. How many SAMPLES? And how many VARIABLES per sampled unit? One sample, one variable, tested against a claimed distribution: goodness-of-fit, expected counts \(E = n \times p\), df = \(k - 1\). One sample, two variables cross-classified: independence, expected counts from the margins, df = \((r-1)(c-1)\). Several samples, one shared variable, compared across populations: homogeneity - the same margin-built expecteds and df as independence. The sample count is the design's fingerprint; the variable count is the question's.

The shared arithmetic

Whatever the test, the ritual is identical once the expecteds exist: compute \(\chi^2\) over every category or cell, take the degrees of freedom the design dictates, read the right tail, and inspect the residuals for where the story lives. Conditions travel as a set too: random data, expected counts of at least about 5 everywhere, and counts - never percentages - in the formula. A student who can build expected counts can run all three tests; the only genuinely new skill in this topic is choosing.

Worked example: six scenarios classified

Name each test. a) Is this die fair? One sample, one variable (face), a claimed 1/6 distribution: goodness-of-fit. b) One survey cross-classifies voters by region and candidate: one sample, two variables: independence. c) Separate random polls of 500 voters in each of three regions ask candidate preference: three samples, one variable: homogeneity. d) Do pea shapes follow a predicted ratio? One sample, one variable, a claimed distribution: goodness-of-fit. e) Do warranty purchases associate with age group, from one cross-classified sample of buyers: independence. f) Three production lines each sampled for defect type: several samples, one variable: homogeneity. Check: every scenario answered "how many samples, how many variables" before naming a test.

Worked example: one table, two designs

The warranty table - 42, 108, 66, 84 - gives \(\chi^2 = 8.33\) at df 1, \(p \approx 0.004\), whichever design gathered it. If one random sample of 300 buyers was cross-classified, the conclusion reads: warranty choice and age are ASSOCIATED (independence). If instead 150 buyers under 40 and 150 aged 40 or older were sampled separately, the same arithmetic concludes: the two age groups' warranty DISTRIBUTIONS differ (homogeneity). Identical numbers, identical \(\chi^2\), different statements - which is exactly why the test's name must follow the design, not the arithmetic.

The 2 x 2 bridge to the z test

A quiet connection ties this family back to section J. When a table is \(2 \times 2\) - both variables binary, say warranty yes/no by age group - the chi-square test and the two-sided, pooled two-proportion z test answer the same question, and their statistics satisfy \(\chi^2 = z^2\): the warranty table's \(\chi^2 = 8.33\) corresponds to \(z = \sqrt{8.33} \approx 2.89\), and both tests give \(p \approx 0.004\). Neither is wrong; the chi-square view generalises to bigger tables, while the z view makes the difference of two proportions explicit and also allows a one-sided alternative. Knowing the bridge keeps a \(2 \times 2\) analysis from feeling like a choice with a right answer - it is a choice of vocabulary.

When none of the three fits

The chi-square family serves independent counts in categories, and some count questions fall outside all three tests. Paired count data - the same people classified twice, before and after a treatment - violates the independence the family requires, and forcing it into an independence test answers a question the design never asked. Very thin counts (expecteds under 5 even after merging) and ordinal questions - "is this rating HIGHER than that one?" - also point elsewhere, to methods beyond this course: McNemar's test for paired counts, exact tests for thin tables, rank-based methods for ordinal data. Knowing when the family does not apply is part of knowing it.

Common mistakes to avoid

First, naming the test after the table's shape - a 2 × 2 table can be either independence or homogeneity; the design decides. Second, switching expected-count formulas between tests: claims build \(E = np\), tables build \(E = \text{row} \times \text{col}/\text{grand}\). Third, quoting a chi-square result with no residuals: all three tests answer "where" only through them. Fourth, percentages in the formula. Fifth, treating a rejected independence null as evidence of causation. Sixth, testing paired classifications with any of the three - the design disqualifies them before the arithmetic begins.

Key takeaways

Three chi-square tests share one machine; the design chooses the intake. One sample, one variable, a claimed distribution: goodness-of-fit, \(E = np\), df = \(k-1\). One sample, two variables: independence, margin-built expecteds, df = \((r-1)(c-1)\). Several samples, one variable: homogeneity - independence's arithmetic, homogeneity's conclusion. Expected counts of at least about 5, counts not percentages, right tail only, residuals for the where. The same table can carry either an independence or a homogeneity conclusion, depending only on how the data were gathered - so the design is written into the report, not implied by the numbers.

Flashcards

Flashcard

How many samples?

The design's first fingerprint

One vs several picks the intake valve.

Test your understanding

Question 1 of 5

One survey cross-classifies a random sample by coffee preference and study time. Which test?

Question 2 of 5

Separate random samples from four factories each classify defects by type. Which test?

Question 3 of 5

A snack mix claims a 2:1:1 ratio of ingredients; one handful is counted. Which test?

Question 4 of 5

A 2 × 2 table gives χ² = 8.33 at df 1. What determines whether the conclusion is independence or homogeneity?

Question 5 of 5

Which count question falls OUTSIDE all three chi-square tests?

← Previous topicNext topic →