Statistics › Section K · The chi-square distribution › Topic K.4
Test for homogeneity
Do three stores see the same payment mix? Do two regions back the same candidate? The homogeneity test compares one categorical variable's distribution across several populations - the same chi-square arithmetic as independence, built on a different design.
One variable, several populations
The independence test took ONE sample and cross-classified it by two variables. The homogeneity test's design is the reverse: SEVERAL samples, one from each of several populations, each classified by the SAME categorical variable. Three stores each contributing 100 transactions; two regions each polled; four production lines each inspected. The question: is the variable's distribution the same everywhere - are the populations homogeneous - or does it shift from group to group?
The null: same distribution everywhere
The null hypothesis of homogeneity says every population shares one distribution of the variable: the same cash-card-app mix at all three stores, the same support split in both regions. Under that null, the best estimate of the shared distribution pools all samples - and the expected count for each cell is, once again,
The formula's job is the same: build what the null predicts, from totals alone, and let the data argue with it.
Identical arithmetic, different design
Everything downstream is the independence test's: \(\chi^2 = \sum (O - E)^2/E\) over all cells, df = \((r-1)(c-1)\), right tail only, expected counts of at least about 5 per cell. What changes is the DATA's provenance - several independent samples instead of one cross-classified sample - and therefore what a rejection means. Independence rejection: the two variables associate within one population. Homogeneity rejection: the populations differ in their distribution of one variable. Same mathematics; the design writes the conclusion.
Worked example: three stores' payment mixes
Each of three stores contributes 100 transactions, classified cash, card, or app. Store 1: 40, 45, 15. Store 2: 25, 50, 25. Store 3: 20, 60, 20. Column totals: cash 85, card 155, app 60. 1. Expected per store: \(100 \times \frac{85}{300} \approx 28.3\) cash, \(\approx 51.7\) card, \(20\) app - the same for all three stores under homogeneity. 2. \(\chi^2 \approx 4.80 + 0.86 + 1.25 + 0.39 + 0.05 + 1.25 + 2.45 + 1.34 + 0 \approx 12.4\) with df = \((3-1)(3-1) = 4\). 3. \(p \approx 0.014 \le 0.05\): reject - convincing evidence the payment mixes differ, and the residuals say where: store 1 runs cash-heavy (40 against 28.3), store 3 card-heavy (60 against 51.7).
Worked example: reading the stores' residuals
A homogeneity rejection is a statement about populations: these stores' customers do not all pay the same way. The residuals \((O - E)/\sqrt{E}\) say how. 1. Store 1 cash: \((40 - 28.3)/\sqrt{28.3} \approx 2.19\), the largest. 2. Store 3 cash: \((20 - 28.3)/\sqrt{28.3} \approx -1.57\). 3. Store 3 card: \((60 - 51.7)/\sqrt{51.7} \approx 1.16\). 4. Store 1 app and store 2 app: about \(-1.12\) and \(+1.12\). Reading: store 1 leans cash, store 3 leans card and away from cash, store 2 sits closest to the pooled mix. Check: the residuals in each column sum to zero, as they must when every store has the same size. The design limits remain: the stores were sampled, not manipulated, so "why" is out of the test's reach (store 1 might serve an older clientele, or sit near a cash machine).
Choosing independence or homogeneity
Since the arithmetic is identical, the choice is made by reading the design, before any computation. One random sample, cross-classified by two variables: independence - the question is whether the variables associate. Several independent samples, one variable each: homogeneity - the question is whether the populations match. Ambiguity is rare but real: a survey that asks voters their region AND their candidate is one sample (independence); a pollster who samples 500 voters in each region separately is several samples (homogeneity). State which design produced the data, and the test names itself.
Conditions: each sample must qualify
The conditions multiply across samples. Each sample is random and independent of the others - separate draws from separate populations, with the 10% rule applying per population. Expected counts reach at least about 5 in every cell, judged on the pooled expectation as before. The samples need not be the same size, since the expected counts scale with each row total, but they should be collected the same way: if one store's 100 transactions came from a single busy hour and the others from a whole week, a difference in mix may reflect the collection rather than the customers.
Common mistakes to avoid
First, calling the test independence when the design is several samples - the arithmetic forgives, the conclusion does not. Second, building expected counts per sample instead of from the pooled margins. Third, wrong df: \((r-1)(c-1)\) counts the table's freedom, whichever design filled it. Fourth, calling one sample that was later sorted by store "three samples": that is one cross-classified sample, so the test is independence. Fifth, percentages in the formula: counts only. Sixth, interpreting rejection as "every store differs from every other": the test says the distributions are not all identical, and the residuals show which ones lean.
Key takeaways
Homogeneity compares one categorical variable's distribution across several independently sampled populations, under the null that every population shares the same distribution. Expected counts come from the pooled margins - \(E = \text{row} \times \text{column}/\text{grand}\) - and the statistic is the same \(\chi^2 = \sum (O-E)^2/E\) on \((r-1)(c-1)\) degrees of freedom, right tail only, expecteds of at least about 5. The stores: \(\chi^2 \approx 12.4\) at df 4, \(p \approx 0.014\) - the payment mixes differ, store 1 cash-heavy and store 3 card-heavy. Independence or homogeneity is decided by the design - one cross-classified sample or several - and the design writes the conclusion.
Flashcards
Flashcard
Do several populations share one distribution?
Test your understanding
Question 1 of 5
A researcher polls 500 voters in each of three regions and asks their candidate preference. The right chi-square test is:
Question 2 of 5
Under the null of homogeneity, expected counts are built from:
Question 3 of 5
For the 3 × 3 stores table, the degrees of freedom are:
Question 4 of 5
The stores' test gives χ² ≈ 12.4 at df 4, p ≈ 0.014. At α = 0.05:
Question 5 of 5
One random sample is cross-classified by exercise habit and sleep quality. The right chi-square test is:
