Null and alternative hypotheses
A surf school says that 80% of its beginners stand up on their first lesson. Before anyone looks at data, what exactly is the claim being tested, and what would count against it?
Where you are 7 in Hypothesis testing
Why this exists
A made-up surf school on Oahu advertises that 80\% of beginners stand up on their first lesson. Makoa, thinking of signing up, doubts it. He watches 50 beginners and sees 36 of them stand up, a sample proportion of \displaystyle \frac{36}{50} = 0.72. Is that evidence that the advertisement is wrong?
Not by itself. The 0.72 is a statistic, worked out from the 50 beginners he watched; the advertisement is about a parameter, the share of all the school’s beginners (see parameters and statistics). Even if the true share were exactly 0.80, a sample of 50 would rarely land on exactly 0.80, because statistics vary from sample to sample. So the question has to be asked more carefully: is 0.72 further below 0.80 than chance alone would usually carry a sample?
To ask that, Makoa first has to say precisely which claim he is testing and what he suspects instead. Those two statements are the null hypothesis and the alternative hypothesis, and every hypothesis test starts by writing them down.
Definition
A hypothesis in statistics is a claim about a parameter of a population, such as a population proportion p or a population mean \mu.
The null hypothesis, written H_0, is the claim of no effect, no change, no difference, or the value someone has claimed. It is always written as an equality: the parameter equals one particular number, called the null value.
The alternative hypothesis, written H_a, is the claim the study is looking for evidence of. It says the parameter differs from the null value in a stated way, and it uses one of three signs:
- < (the parameter is less than the null value), a one-sided alternative;
- > (the parameter is greater than the null value), also one-sided;
- \neq (the parameter is not equal to the null value, in either direction), a two-sided alternative.
Which sign is used comes from the research question, and it is chosen before the data are seen. Some books write H_A or H_1 for the alternative; the meaning is the same.
Every set of hypotheses comes with a sentence that defines the parameter in words, in context: which number, about which population. For the surf school: p is the proportion of all the school’s beginners who stand up on their first lesson. The same pattern covers each kind of parameter in this course.
| Parameter | What it is | Usual null hypothesis |
|---|---|---|
| p | one population proportion | H_0\colon p = p_0, a claimed value |
| \mu | one population mean | H_0\colon \mu = \mu_0, a claimed value |
| p_1 - p_2 | difference of two population proportions | H_0\colon p_1 - p_2 = 0, no difference |
| \mu_1 - \mu_2 | difference of two population means | H_0\colon \mu_1 - \mu_2 = 0, no difference |
Here p_0 and \mu_0 stand for the null value in the question at hand.
Intuition
Figure 1 draws each hypothesis as the set of values of p it names. The null hypothesis is a single point. Each alternative is a stretch of the line that leaves the null value out.
A hypothesis test works like a fair trial. The null hypothesis is the presumption of innocence: it is assumed true, and the data have to argue against it. The test asks: if H_0 were true, how surprising would data like ours be? Ordinary data make no case against H_0. Very unusual data, unusual in the direction H_a points, are evidence for H_a. The number that measures this surprise is the p-value, the subject of a later lesson.
This is the same logic as comparing treatments by rerandomizing: there, “the treatment does nothing” was assumed, the data were reshuffled to see what chance alone produces, and the real result was compared with that. The words “null hypothesis” give that assumption its name.
Results
Hypotheses are about parameters. H_0 and H_a always name a population value (p, \mu, p_1 - p_2, \mu_1 - \mu_2), never a statistic such as \hat{p} or \bar{x}.
H_0 is an equality; H_a is a strict inequality. The null value in H_a is the same number as in H_0, and H_a never includes it.
The question picks the side. “Fewer” or “lower” gives <; “more” or “higher” gives >; “different”, “changed” or “is the claim accurate” gives \neq. The choice comes before the data.
A test can give evidence against H_0; it cannot prove H_0. Data that fit H_0 are also consistent with values near the null value, so the possible conclusions are to reject H_0 in favor of H_a or to fail to reject it (see deciding and concluding).
Why it is true
Why a parameter. A statistic is known as soon as the sample is measured: Makoa’s \hat{p} is 0.72, and nobody needs a test to find that out. What is unknown, and so what can be doubted, is the parameter. A hypothesis that names a statistic is either already true or already false.
Why an equality. To ask how surprising the data would be if H_0 were true, one needs a single model of how samples behave, and that needs a single value of the parameter. “p = 0.80” gives one: from it, how far sample proportions stray can be worked out (their spread is the standard error). “p \neq 0.80” gives no single value to work from, so it can only be the alternative.
Why before the data. Suppose the sample proportions from a true p = 0.80 spread evenly on both sides of 0.80. A result some distance below 0.80 is then about half as likely as a result that far from 0.80 on either side. If Makoa waited to see which way his sample fell and then pointed H_a that way, he would always be using the side that makes his data look more surprising, so a result chance alone produced would look about twice as convincing as it is. Fixing H_a from the question, before the data, keeps the data from choosing their own test.
Worked examples
The skeptical customer
Makoa thinks the school’s advertised 80\% is too high. Define the parameter and write his null and alternative hypotheses, in words and in symbols.
SolutionThe claim is about all the school’s beginners, so the parameter is a population proportion: p is the proportion of all the school’s beginners who stand up on their first lesson. The null hypothesis is the advertised value:
In words: 80\% of the school’s beginners stand up on their first lesson, as advertised.
Makoa suspects the true share is lower, and a higher share would not bother him as a customer. His question points one way, so his alternative is one-sided:
In words: fewer than 80\% of the school’s beginners stand up on their first lesson.
The owner’s new method
Kekoa, who owns the school, starts teaching beginners a new way to pop up, practiced on the sand before they paddle out. He believes it raises the share who stand up on the first lesson above the 80\% the school has always advertised. Define the parameter and write his hypotheses.
SolutionKekoa’s question is about beginners taught the new way, so that is the population: p is the proportion of all beginners taught the new pop-up who stand up on their first lesson. The claim of no effect is that the new method changes nothing:
He is looking for evidence of an improvement, so the alternative points up:
The null value is the same as in Example 1; the alternative points the other way, because the question does.
The neutral reviewer
Pualani writes reviews of surf schools. She wants to report whether the school’s 80\% is accurate, and she would report a share that turned out higher just as readily as one that turned out lower. Write her hypotheses.
SolutionThe parameter is the one in Example 1, the proportion of all the school’s beginners who stand up on their first lesson. The null hypothesis is again the advertised value:
Pualani has no suspected direction: a true share of 0.90 or of 0.70 would both make the advertisement wrong, and she would report either. So the alternative is two-sided:
Examples 1 to 3 are the last three rows of Figure 1: one claim, three questions, three correct alternatives.
Hypotheses about a mean
The school’s website says beginners catch a mean of 6 waves per session. Pualani records 30 beginner sessions and finds a mean of 5.4 waves. A friend helping with the review writes
Explain what is wrong, and write the hypotheses Pualani should test.
SolutionThe friend’s hypotheses name \bar{x}, the sample mean. That is a statistic, and it is already known: \bar{x} = 5.4. So “\bar{x} = 6” is simply false and “\bar{x} < 6” simply true, and nothing is left to test. The website’s claim is about every beginner session at the school, so the parameter is a population mean: \mu is the mean number of waves caught per session over all the school’s beginner sessions.
There is a second problem. The friend chose “<” because the data came out low. Pualani’s question is neutral, as in Example 3, so the side comes from that question and not from the data:
Two instructors
Kekoa and Pualani both teach beginners at the school. Makoa wants to know whether the share of beginners who stand up on their first lesson differs between the two instructors. Define the parameters and write the hypotheses. Then write the alternative for a different question: does Kekoa’s share exceed Pualani’s?
SolutionThere are now two populations, so two parameters: p_1 is the proportion of all Kekoa’s beginners who stand up on their first lesson, and p_2 the same for Pualani’s. “No difference between the instructors” is p_1 = p_2, written as a difference so that the null value is 0:
Makoa asks whether the shares differ, in either direction, so
For the second question, “Kekoa’s share exceeds Pualani’s” means p_1 > p_2, that is p_1 - p_2 > 0, so H_a\colon p_1 - p_2 > 0 with the same H_0. Had the labels been the other way round, with p_1 for Pualani, the same claim would read p_1 - p_2 < 0. In a one-sided test of a difference, the sign of H_a depends on the order of subtraction, which is why the parameters must be defined in words.
When the data point the other way
Makoa set up H_0\colon p = 0.80 against H_a\colon p < 0.80, as in Example 1. On a later visit he watches a fresh group of 50 beginners, and 45 stand up. He now wants to change his alternative to H_a\colon p > 0.80 and test that with these data. What do the data say about his original hypotheses, and why should he not switch?
SolutionHis sample proportion is
which is above the null value. His alternative says the true share is below 0.80; a sample above 0.80 points away from that, so these data give no evidence at all for H_a\colon p < 0.80. He fails to reject H_0, which is not the same as showing the advertisement is right.
Switching to p > 0.80 after seeing 0.90 lets the data pick the direction of the test, which makes a chance result look more convincing than it is (see “Why it is true”). If the new question interests him, he can write H_a\colon p > 0.80 now and test it on a sample not yet seen.
Boundaries
Only parameters. A claim about the sample in hand is not a hypothesis; it is checked by looking. And the population in the hypotheses must be the one the sample came from: watching only Kekoa’s beginners says nothing directly about the whole school.
One value in H_0. The null must name a single value to compute from. Some books write a one-sided null as an inequality, such as H_0\colon p \geq 0.80 against H_a\colon p < 0.80; the test is still carried out at the boundary value p = 0.80, the null value closest to the alternative.
A one-sided test looks one way. With H_a\colon p < 0.80, a true share above 0.80 can never be detected, however clear the data (Example 6). And hypotheses chosen or changed after the data are seen do not carry the meaning a test gives them.
A test does not give cause. Evidence that p > 0.80 for Kekoa’s new method shows the share is above 0.80, not that the method raised it: a calmer season or a different crowd of beginners could do the same. A claim about cause needs beginners assigned to the methods at random, compared through p_1 - p_2.
Where this goes next
Once the hypotheses are written, the data are summarized by a test statistic, which says how many standard errors the statistic sits from the null value. The p-value turns that into the surprise this lesson only named: the chance, if H_0 were true, of data at least as far in the direction of H_a. A randomization test finds that chance by reshuffling instead of by formula. Comparing the p-value with a chosen cutoff gives the decision, to reject H_0 or not. A two-sided test and a confidence interval at the matching confidence level turn out to be closely linked.
Exercises
Writing hypotheses about one proportion
- The school’s rental counter claims that 95\% of rented boards come back undamaged. Pualani, who runs the counter, suspects damage has risen this season. Define the parameter and write her hypotheses.
- The school says 30\% of its beginners book a second lesson. Kekoa starts offering a discount on the second lesson and wants evidence that it raises that share. Define the parameter and write his hypotheses.
- A forecast site says the waves at the school’s break are over 3 feet on 40\% of mornings. Makoa wants to know whether that is accurate, with no direction in mind. Write his hypotheses.
- Each statement is about the school’s beginners, with null value 0.80. Write H_a for each: (a) “fewer than 80\% stand up”; (b) “more than 80\% stand up”; (c) “the share has changed since last year, when it was 80\%”; (d) “the advertised 80\% is too low”.
Means and differences
- The school says a beginner lesson spends a mean of 90 minutes in the water. Makoa suspects lessons run short. Define the parameter and write his hypotheses.
- Intermediate students at the school catch a mean of 12 waves per session. Pualani tries a new warm-up and wants to know whether it changes that mean, in either direction. Write her hypotheses.
- Makoa suspects that Pualani’s beginners catch more waves per session, on average, than Kekoa’s. Let \mu_1 be the mean for all Kekoa’s beginners and \mu_2 for all Pualani’s. Write the hypotheses.
- Repeat Exercise 7 with the labels swapped: \mu_1 for Pualani’s beginners and \mu_2 for Kekoa’s.
- Kekoa thinks morning lessons, when the wind is lighter, give a higher share of beginners who stand up than afternoon lessons. Define two parameters and write the hypotheses.
Finding the fault
- A student writes H_0\colon \hat{p} = 0.80, H_a\colon \hat{p} < 0.80 for Makoa’s question. What is wrong? Write the correct version.
- A student writes H_0\colon p < 0.80, H_a\colon p = 0.80. What is wrong? Write the correct version.
- A student writes H_0\colon \mu = 7, H_a\colon \mu > 8. What is wrong? Write the correct version.
- Makoa watches 50 beginners and 41 stand up. He then writes H_0\colon p = 0.82. Find his sample proportion and explain what is wrong with this null hypothesis.
- Pualani’s question is neutral, as in Example 3. In her sample, 38 of 50 beginners stand up, and she then chooses H_a\colon p < 0.80. Find her sample proportion and explain what is wrong.
Reasoning
- Explain why the null hypothesis is written with an equals sign and the alternative never is.
- Explain why hypotheses are written about p and not about \hat{p}.
- Kekoa compares this season’s beginners, all taught the new pop-up, with the 80\% the school has advertised for years, and finds evidence that p > 0.80. Can he conclude the new method caused the rise? Describe a study that could support that claim, and its hypotheses.
- Someone says: “The data gave no evidence against H_0\colon p = 0.80, so the school’s claim is proved.” Respond.
- Makoa, Kekoa and Pualani all test the same advertised 80\%, yet write three different alternatives. Explain how all three can be correct.
Answers
- p = the proportion of all boards rented this season that come back undamaged. H_0\colon p = 0.95, H_a\colon p < 0.95. More damage means fewer undamaged boards, so the alternative points down.
- p = the proportion of all beginners offered the discount who book a second lesson. H_0\colon p = 0.30 (the discount changes nothing), H_a\colon p > 0.30.
- p = the proportion of all mornings with waves over 3 feet at the break. H_0\colon p = 0.40, H_a\colon p \neq 0.40, two-sided because either direction matters.
- (a) H_a\colon p < 0.80. (b) H_a\colon p > 0.80. (c) H_a\colon p \neq 0.80, since “changed” allows either direction. (d) H_a\colon p > 0.80: if 80\% is too low, the true share is above it.
- \mu = the mean time in the water, in minutes, over all the school’s beginner lessons. H_0\colon \mu = 90, H_a\colon \mu < 90.
- \mu = the mean number of waves per session for all intermediate students who do the new warm-up. H_0\colon \mu = 12, H_a\colon \mu \neq 12.
- H_0\colon \mu_1 - \mu_2 = 0, H_a\colon \mu_1 - \mu_2 < 0. Pualani’s mean larger means \mu_2 > \mu_1, so \mu_1 - \mu_2 is negative.
- H_0\colon \mu_1 - \mu_2 = 0, H_a\colon \mu_1 - \mu_2 > 0. The claim is unchanged; swapping the labels flips the sign of the difference.
- p_1 = the proportion of all beginners in morning lessons who stand up on their first lesson; p_2 the same for afternoon lessons. H_0\colon p_1 - p_2 = 0, H_a\colon p_1 - p_2 > 0.
- \hat{p} is a statistic, already known once the sample is in; the claim is about the population. Correct: H_0\colon p = 0.80, H_a\colon p < 0.80, with p the proportion of all the school’s beginners who stand up on their first lesson.
- The roles are swapped: the equality belongs in H_0 and the inequality in H_a. Correct: H_0\colon p = 0.80, H_a\colon p < 0.80.
- The alternative must use the null value. H_a\colon \mu > 8 leaves out every value above 7 up to and including 8. Correct: H_0\colon \mu = 7, H_a\colon \mu > 7.
- \displaystyle \hat{p} = \frac{41}{50} = 0.82. The null value comes from the claim being tested, the advertised 0.80, not from the data; 0.82 is the statistic. Correct: H_0\colon p = 0.80.
- \displaystyle \hat{p} = \frac{38}{50} = 0.76. She chose the side after seeing that the data fell below 0.80, which lets the data pick the test and overstates the evidence. Her question is neutral, so H_a\colon p \neq 0.80.
- The test asks how surprising the data would be if H_0 were true, which needs one value of the parameter to work out how statistics vary. An equality gives one value; an inequality such as p \neq 0.80 gives none in particular.
- \hat{p} is known the moment the sample is measured, so a claim about it is settled by looking. The unknown is p, and that is what the study is about.
- No. This season could differ from past ones in waves, weather or the beginners who came. To support cause, assign beginners at random to the old and new methods in one season. With p_1 for the new method and p_2 for the old: H_0\colon p_1 - p_2 = 0, H_a\colon p_1 - p_2 > 0.
- No evidence against H_0 is not proof of it. Data that fit p = 0.80 also fit values near it, such as 0.78 or 0.83. The conclusion is to fail to reject H_0.
- The null value comes from the claim they share, so all use H_0\colon p = 0.80. The alternative comes from each question: Makoa suspects lower (<), Kekoa hopes his method gives higher (>, for beginners taught the new way), Pualani asks about either way (\neq).