From a Research Question to Hypotheses
In “Independence Versus Homogeneity: Choosing the Right Test,” you learned to identify an independence setting: one sample is classified by two categorical variables, and the research question asks whether they are associated. This tutorial focuses on the next step—writing the hypotheses for that test.
The hypotheses describe the relationship between the two variables in the population represented by the sample. They do not describe what happened in the sample, and they do not claim that the sample was selected independently. The null hypothesis says the population variables are independent. The alternative says they are associated.
“Independent” has a specific statistical meaning here: knowing an individual’s category for one variable does not change the distribution of that individual’s category for the other variable. “Associated” means that the distribution of one variable differs for at least some categories of the other variable.
Start by naming each variable and the population of interest. Then state the null and alternative in words, using the actual variable names and population. This makes the hypotheses understandable even to someone who has not seen the study description.
Writing the Hypotheses in Context
A useful general form is:
The phrases “are independent” and “are associated” need context. For example, “In the population of adult commuters in the region, usual commute method and whether a person usually travels alone are independent” is more informative than “\(H_0\): independent.” The alternative should name the same variables and population.
For a more formal description, let \(X\) and \(Y\) represent the two categorical variables for an individual from the population. Under independence, the probability of any particular combination of categories equals the product of the two separate category probabilities. For every category pair \(i,j\), this can be written as:
You usually do not need to write this probability statement when an AP question asks you to state hypotheses. The contextual statements are the central answer. The expression helps explain what independence means: the population pattern of combined categories follows from the separate distributions of the two variables.
An equivalent way to think about the null is that the distribution of one variable is the same across all categories of the other variable. If those distributions differ, the variables are associated. This is about a pattern across the population, not a claim that every sample count must match perfectly.
What the Alternative Does—and Does Not—Say
For a test of independence, the alternative is generally not written as “Variable A increases Variable B” or “Variable A causes Variable B.” Categorical variables may have several categories, and their association may take many forms. The test asks whether there is evidence of some association, without specifying a direction in advance.
For example, if a survey records a person’s preferred type of exercise and their usual time of day for exercising, an association could appear in many ways. Morning exercise might be more common among people who prefer one activity, while evening exercise might be more common among people who prefer another. The hypothesis \(H_a\) does not predict one particular pattern; it says the variables are associated.
The null hypothesis is also not a claim that two variables are unrelated in every possible sense, or that one cannot affect the other. It states independence for the two variables being studied in the population. The test evaluates evidence about that stated relationship using the observed categorical counts.
As covered in “Chi-Square Test for Independence: Purpose and Setting,” an appropriate random sample and independent observations matter when conducting the test. Those are design and condition questions, separate from the content of \(H_0\) and \(H_a\). Likewise, a finding of association in an observational study does not by itself show that one variable causes the other.
Worked Example: Commute Method and Traveling Alone
Worked Example: Commute Method and Traveling Alone
A city researcher takes one random sample of adult commuters. For each person, the researcher records the person’s usual commute method—car, bicycle, or public transit—and whether the person usually travels alone. The question is whether commute method and traveling alone are associated among adult commuters in the city.
Define the variables and population. The two categorical variables are usual commute method and usual travel arrangement (alone or not alone). The population of interest is all adult commuters in the city.
State the null hypothesis. \(H_0\): Among adult commuters in the city, usual commute method and usual travel arrangement are independent. In context, the distribution of travel arrangement is the same for commuters who usually drive, bicycle, or use public transit.
State the alternative hypothesis. \(H_a\): Among adult commuters in the city, usual commute method and usual travel arrangement are associated. In context, the distribution of travel arrangement differs for at least some commute methods.
The alternative does not claim that a particular commute method makes someone travel alone. It states only that the two population variables are associated. This wording matches a test of independence and does not turn the survey into a cause-and-effect study.
Worked Example: Device Type and Preferred Support Channel
Worked Example: Device Type and Preferred Support Channel
A fictional technology company selects one random sample of customers. Each sampled customer identifies their primary device—phone, tablet, or laptop—and their preferred way to get technical help—online chat, phone call, or help article. The company asks whether primary device and preferred support channel are associated among its customers.
Define the variables and population. The variables are primary device and preferred support channel. The population is the company’s customers.
State the null hypothesis. \(H_0\): Among the company’s customers, primary device and preferred support channel are independent. The distribution of preferred support channels is the same for customers whose primary device is a phone, tablet, or laptop.
State the alternative hypothesis. \(H_a\): Among the company’s customers, primary device and preferred support channel are associated. The distribution of preferred support channels differs for at least some primary-device categories.
The hypotheses refer to the population of customers, not just the sampled customers. A sample table might show different percentages across device categories even if the population variables are independent; the test assesses whether the sample pattern provides convincing evidence of a population association.
Worked Example: Garden Type and Pest Presence
Worked Example: Garden Type and Pest Presence
A community garden coordinator takes one random sample of household gardens in a town. For each garden, the coordinator records its type—container, raised-bed, or in-ground—and whether a specified garden pest was observed. The research question is whether garden type and pest presence are associated in the town’s household gardens.
Define the variables and population. The two categorical variables are garden type and whether the specified pest was observed. The population is all household gardens in the town.
State the null hypothesis. \(H_0\): In the town’s household gardens, garden type and pest presence are independent. The distribution of pest presence is the same across the three garden types.
State the alternative hypothesis. \(H_a\): In the town’s household gardens, garden type and pest presence are associated. The distribution of pest presence differs for at least one garden type.
The alternative does not specify which garden type would have more pest observations. It also does not say that garden type causes pest presence. It states a population relationship, which is the question addressed by a test of independence.
Common Mistakes and AP Exam Communication
A strong hypothesis statement is specific enough to identify both variables and the population. It also keeps the null and alternative logically matched: independence in the null, association in the alternative. Several common errors can make an otherwise correct test setup unclear.
- Writing hypotheses about the sample: “The sample variables are independent” describes the observed data, not the population claim being tested. State the relationship in the population represented by the sample.
- Writing only “no difference”: That wording can be vague when there are several categories. For independence, state that the two named variables are independent, or explain that the distribution of one is the same across categories of the other.
- Using a directional alternative: \(H_a\) is not “one category has a higher proportion” unless a different, suitable procedure and question call for that. A chi-square test of independence asks whether there is an association, not whether it points in a prespecified direction.
- Mixing up association and causation: “The variables are associated” does not mean that one causes the other. Describe the relationship the test addresses, and let the study design determine what further conclusions are justified.
- Confusing variable independence with independent observations: The null concerns the relationship between two variables. The independence of observations is a condition about how the data were collected. These are distinct uses of the word “independent.”
- Leaving out the population: “Commute method and travel arrangement are associated” is less complete than naming the population of adult commuters in the city. A contextual population statement clarifies what the hypotheses concern.
Key Takeaway
For a chi-square test of independence, the hypotheses make a claim about the relationship between two categorical variables in a population. The null says they are independent; the alternative says they are associated. Contextual wording makes clear which variables and population are being discussed.
Check Your Understanding
For each setting, identify the population and write contextual null and alternative hypotheses for a test of independence.
- A random sample of students reports both their usual study location and whether they usually study alone. The question concerns students at the school.
- A random sample of households reports both its main heating source and whether it has a programmable thermostat. The target population is households in the county.
- A random sample of visitors to a nature reserve reports both their main activity and whether they visited on a weekday or weekend. The question asks whether those variables are associated among reserve visitors.
- Explain why “the sample’s two variables are associated” is not an appropriate alternative hypothesis for a population test.
- In a test of independence, what does “independent” mean in the null hypothesis, and how is that different from the independence of observations?