Mathwords logoMathwords

Homogeneity of Proportions Test — Definition, Formula & Example

A homogeneity of proportions test is a chi-square test that checks whether two or more separate groups have the same distribution across the categories of one categorical variable. For example, it can test whether students at two schools prefer lunch options in the same proportions.

Given independent random samples from rr populations, each classified into cc categories, the test evaluates H0H_0: the category proportions p1,…,pcp_1, \dots, p_c are identical in all rr populations, against HaH_a: at least one population has a different distribution. The statistic χ2=∑(O−E)2/E\chi^2 = \sum (O-E)^2/E approximately follows a chi-square distribution with (r−1)(c−1)(r-1)(c-1) degrees of freedom when H0H_0 is true.

Key Formula

χ2=∑all cells(O−E)2E,E=(row total)(column total)grand total,df=(r−1)(c−1)\chi^2 = \sum_{\text{all cells}} \frac{(O - E)^2}{E}, \qquad E = \frac{(\text{row total})(\text{column total})}{\text{grand total}}, \qquad df = (r-1)(c-1)
Where:
  • OO = Observed count in a cell
  • EE = Expected count in that cell if H0H_0 is true
  • rr = Number of rows (populations or groups)
  • cc = Number of columns (categories)

How It Works

Put the observed counts in a two-way table, with one row per population. Compute each expected count from the row and column totals. Check the conditions: the samples are random and independent, each sample is under 10% of its population, and every expected count is at least 5. Add up (O−E)2/E(O-E)^2/E over all cells, then find the p-value from the chi-square distribution with (r−1)(c−1)(r-1)(c-1) degrees of freedom. A small p-value is evidence that the distributions differ.

Worked Example

Problem: You randomly survey 100 students at School A and 100 students at School B about their favorite lunch. School A: 50 pizza, 20 salad, 30 sandwich. School B: 30 pizza, 20 salad, 50 sandwich. At α=0.05\alpha = 0.05, is the distribution of lunch preference the same at both schools?
Step 1: State H0H_0: the distribution of lunch preference is the same at both schools. HaH_a: the distributions differ. The column totals are 80, 40, and 80, and the grand total is 200. Find the expected counts. Every row has total 100, so each row gets the same expected counts, and all of them are at least 5.
Epizza=100⋅80200=40,Esalad=100⋅40200=20,Esandwich=100⋅80200=40E_{\text{pizza}} = \frac{100 \cdot 80}{200} = 40, \quad E_{\text{salad}} = \frac{100 \cdot 40}{200} = 20, \quad E_{\text{sandwich}} = \frac{100 \cdot 80}{200} = 40
Step 2: Add up the contributions from all six cells. List School A first, then School B.
χ2=(50−40)240+(20−20)220+(30−40)240+(30−40)240+(20−20)220+(50−40)240=2.5+0+2.5+2.5+0+2.5=10\chi^2 = \frac{(50-40)^2}{40} + \frac{(20-20)^2}{20} + \frac{(30-40)^2}{40} + \frac{(30-40)^2}{40} + \frac{(20-20)^2}{20} + \frac{(50-40)^2}{40} = 2.5 + 0 + 2.5 + 2.5 + 0 + 2.5 = 10
Step 3: Find the degrees of freedom and the p-value. When df=2df = 2, the upper-tail probability is exactly e−x/2e^{-x/2}.
df=(2−1)(3−1)=2,p=P(χ22≥10)=e−5≈0.0067df = (2-1)(3-1) = 2, \qquad p = P(\chi^2_2 \ge 10) = e^{-5} \approx 0.0067
Answer: χ2=10\chi^2 = 10, df=2df = 2, and p≈0.0067p \approx 0.0067. This is less than 0.050.05, so reject H0H_0. There is convincing evidence that lunch preferences are not distributed the same way at the two schools.

Why It Matters

AP Statistics Unit 8 asks you to choose between the chi-square tests for homogeneity, independence, and goodness of fit, and the free-response questions grade that choice. Researchers use the homogeneity test to compare groups such as treatment arms in a clinical trial or customer segments in a marketing survey.

Common Mistakes

Mistake: Calling the test a test for independence or homogeneity based only on how the table looks.
Correction: The arithmetic is identical, so the choice depends on the study design. Use homogeneity when you take separate samples from two or more populations and record one variable. Use independence when you take one sample and record two variables for each subject.

Related Terms