Start With the Study Design
The previous tutorial, “Independence and 10 Percent Condition for Chi-Square,” addressed how sampling can support treating observations as independent. Before checking that condition or calculating a statistic, there is a more basic question: which chi-square test, if any, matches the study description?
A chi-square test of independence and a chi-square test of homogeneity both use categorical counts arranged in a two-way table. The table alone does not tell you which test to choose. The key is how the data were collected: was there one sample classified by two categorical variables, or were separate groups compared on one categorical response?
For example, the question “Are commute method and work schedule associated among residents?” points toward independence if one sample of residents reports both characteristics. The question “Does the distribution of commute methods differ among three regions?” points toward homogeneity if a separate sample is selected from each region and each person reports one commute method.
Both designs can produce a table with rows for groups and columns for response categories. Even identical-looking tables can represent different studies. As explained in “Independence Versus Homogeneity: Choosing the Right Test,” the design—not the table’s layout—determines the classification.
A Short Decision Process
Read a scenario for the observational unit, the number and source of samples or groups, and the variable or variables recorded for each unit. Then ask the following questions in order.
Chi-square tests for independence and homogeneity use counts in categories. If the response is a numerical measurement, such as time, distance, or temperature, these are not the appropriate tests for that response.
If each individual in one sample is classified according to two categorical variables, and the question asks whether they are associated, choose a chi-square test of independence.
If separate random samples or treatment groups are compared on the distribution of one categorical response, choose a chi-square test of homogeneity.
If the data are paired, the response is not categorical, or the description does not provide the structure needed for either test, do not force a choice between these two procedures.
The phrase “one sample classified twice” means that the same individual contributes information to both categorical variables. It does not mean that a researcher takes two measurements from the person at different times. Repeated measurements on the same individual are linked, so they are not the ordinary one-sample independence setting.
Likewise, “separate groups” means that the groups are formed through the study design, such as separate samples from different populations or groups created by random assignment. It does not simply mean that a researcher can divide one sample into categories after collecting two characteristics. For that one sample, the two characteristics are the variables whose association is being studied.
What “Neither” Means
“Neither” is a useful and complete classification, not a failure to recognize a test. These two chi-square procedures require categorical counts and a design that matches their purpose. If the study measures a quantitative response, uses linked pairs or repeated measurements, or asks a different kind of question, choosing independence or homogeneity just because the prompt includes groups would be a mistake.
A scenario may also have the structure of an independence or homogeneity study but lack information needed to justify inference. For instance, a volunteer sample can be classified by two categorical variables, so the structure resembles independence; however, volunteering does not establish an appropriate random sample. Separate questions remain about randomization or sampling, independence of observations, and expected counts. As in the earlier tutorials on the random condition and the 10 percent condition, classify the design first, then check the procedure’s conditions.
Worked Example: One Sample, Two Categorical Variables
Worked Example: One Sample, Two Categorical Variables
A fictional city selects a random sample of 360 residents. Each resident reports their primary way of getting local news—printed paper, website, or social media—and whether they live in an apartment or a detached house. The researchers ask whether housing type is associated with primary news source.
Identify the data structure. There is one sample of 360 residents. Each resident is classified according to two categorical variables: housing type and primary news source. The study does not select one sample of apartment residents and a separate sample of detached-house residents; it samples residents and records both characteristics.
Match the question to the test. The research question asks whether the two categorical variables are associated in the population. That is the purpose of a chi-square test of independence.
Answer: This scenario calls for a chi-square test of independence because one sample of residents is classified by two categorical variables, and the question asks whether those variables are associated. The random sample supports the random condition, but the expected counts and other relevant conditions must still be checked before performing the test.
Worked Example: Separate Groups, One Categorical Response
Worked Example: Separate Groups, One Categorical Response
A fictional recreation department randomly assigns 240 volunteers to one of three reminder formats for a community event. After the event, each volunteer is recorded as either attended or did not attend. The department wants to know whether the attendance distribution differs among the three reminder groups.
Identify the data structure. The department creates three separate treatment groups by random assignment. Each volunteer contributes one categorical response: attendance status. The reminder format identifies the group; it is not a second response measured from the volunteer.
Match the question to the test. The department compares the distribution of one categorical response across several groups. This is the purpose of a chi-square test of homogeneity. The groups need not have equal sizes for the design to be a homogeneity setting.
Answer: This scenario calls for a chi-square test of homogeneity because volunteers were assigned to separate reminder groups and the researchers compare one categorical outcome across those groups. Random assignment supports the design for comparing treatment groups, but the independence and expected-count conditions still need to be considered.
Worked Example: A Table Does Not Make Paired Data Independent
Worked Example: A Table Does Not Make Paired Data Independent
A fictional sleep program asks 90 participants whether they use a sleep-tracking app before a four-week program and again after the program. Each answer is yes or no. The program team organizes the results in a two-way table with “before” answers in the rows and “after” answers in the columns, then asks whether app use changed.
Identify the data structure. The table contains two categorical variables: the participant’s before-program answer and after-program answer. But these are not measurements from two independent samples. Every participant contributes both answers, so each before-and-after pair is linked to the same person.
Decide whether either test fits. This is not a chi-square test of homogeneity because the before and after groups are not separate, independent groups of participants. It is also not the standard chi-square test of independence, which treats each individual as one observation classified by two variables under the procedure’s independence requirements. Here, the response pairs are the relevant data structure, and treating the 180 answers as independent observations would ignore the pairing.
Answer: Neither the standard chi-square test of independence nor the standard chi-square test of homogeneity is appropriate for this paired before-and-after design. The fact that the answers can be displayed in a two-way table does not remove the link between each participant’s responses.
Worked Example: A Quantitative Response Is Not a Chi-Square Outcome
Worked Example: A Quantitative Response Is Not a Chi-Square Outcome
A fictional school randomly selects 80 students from each of two campuses and records each student’s one-way travel time to school in minutes. The school asks whether the typical travel time differs between campuses.
Identify the data structure. The school has separate random samples from two groups, which might at first suggest homogeneity. However, the response recorded for each student is travel time in minutes, a quantitative variable—not a categorical outcome recorded as counts in categories.
Decide whether either test fits. The chi-square test of homogeneity compares distributions of a categorical response across groups. The chi-square test of independence also requires two categorical variables. Neither test matches a comparison of travel times as numerical measurements.
Answer: Neither chi-square test fits because the response is quantitative travel time, not a categorical outcome. The presence of two campuses does not make every comparison between them a chi-square problem.
Common Mistakes and AP Exam Tip
- Choosing from the table shape: Both procedures can use a two-way table. State whether the study used one sample classified by two variables or separate groups compared on one response.
- Calling any comparison between groups homogeneity: A comparison between groups is not enough. Homogeneity requires a categorical response whose distribution is compared across separate groups.
- Calling any two-way table independence: A table may contain two categorical variables but still represent paired responses. Check whether each individual contributes one independent observation or linked measurements.
- Confusing group labels with response variables: In homogeneity, the groups are established by sampling or assignment, and the categorical response is recorded within each group. In independence, one sample is classified by two categorical variables.
- Skipping the “neither” option: If the response is quantitative or the observations are paired, do not force the scenario into one of the two procedures simply because it mentions categories or groups.
- Claiming a test is valid from its classification alone: Matching the design to a test does not prove that the random, independence, 10 percent, or expected-count conditions are met. Address those separately when asked to carry out inference.
Check Your Understanding
For each scenario, classify it as a chi-square test of independence, a chi-square test of homogeneity, or neither, and justify your choice from the study design.
- A random sample of residents reports both their preferred recycling method and whether they live in a house or an apartment. Researchers ask whether the two characteristics are associated.
- Separate random samples of customers from four stores each report whether they paid by cash, card, or mobile payment. Researchers compare the payment distributions across stores.
- A group of 75 cyclists reports whether they wear a helmet on two rides, one week apart. Researchers ask whether their helmet use changed.
- Researchers randomly assign 150 plants to three lighting conditions and record each plant’s flower color from four categories. They compare the color distributions across conditions.
- A researcher samples students from two schools and records their weekly screen time in hours. The research question asks whether the mean screen time differs by school.