Setting up a chi-square test

A chi-square test for homogeneity compares one variable across several populations and one for independence asks whether two variables are associated in one population; both compare observed counts with the counts expected if the null hypothesis were true.

From AP Statistics.