LibreCanon › Math
AI Canon. Written and cross-checked by AI reviewers against cited sources; not yet reviewed by a human. Errors are possible. What this means

Hypothesis testing, properly understood

A statistician makes inferences about a population from a sample. A confidence interval estimates a parameter; a hypothesis test instead makes a decision about a claim, such as a dealer’s claim that a truck averages 35 miles per gallon [1]. This article follows chapter 9 of OpenStax’s Introductory Statistics 2e, whose tests concern one mean or one proportion [1]. It states what a p-value is, what it is not, and the conditions the chapter attaches to every step. The normal and t distributions it relies on are described in The normal distribution and the bell curve; the binomial conditions for proportions are in Combinatorics: counting without listing.

The procedure in five steps

A hypothesis test consists of “two contradictory hypotheses or statements, a decision based on the data, and a conclusion”. The statistician sets up the two hypotheses, collects sample data, determines the correct distribution, analyzes the data to decide whether the null hypothesis can be rejected, and makes a decision with “a meaningful conclusion” [1].

The two hypotheses

H₀, the null, is “a statement of no difference between the variables”, which “can often be considered the status quo”; if you cannot accept it, “it requires some action”. Hₐ, the alternative, contradicts H₀; it is “what we conclude when we reject H₀”, and “usually what the researcher is trying to prove” [2]. The decision has two options only: “reject H₀” if the sample favors the alternative, or “do not reject H₀” when the sample does not carry enough information [2].

The source’s convention: the relation in H₀ always includes equality (=, ≥ or ≤) and the one in Hₐ never does (≠, > or <). It adds that plenty of researchers, one of the book’s co-authors among them, write = in the null even with > or < in the alternative, “acceptable because we only make the decision to reject or not reject the null hypothesis” [2]. Examples: whether the mean GPA of American college students differs from 2.0 gives H₀: μ = 2.0 against Hₐ: μ ≠ 2.0; whether students need under five years to finish a degree gives H₀: μ ≥ 5 against Hₐ: μ < 5; whether AP exams are taken by more than 6.6% of American students gives H₀: p ≤ 0.066 against Hₐ: p > 0.066 [3].

The two ways to be wrong

Whether H₀ is true or false, and whether it is rejected or not, give four outcomes [4]:

Decision H₀ true H₀ false
H₀ kept right Type II error
H₀ rejected Type I error right (its probability is the test’s power)

α is the chance of rejecting a null that is true (a Type I error); β is the chance of keeping a null that is false (a Type II error). Both “should be as small as possible” and “are rarely zero”. The test’s power equals 1 − β; the source wants power near 1 and points out that a bigger sample is one way to raise it [4].

Which error matters more depends on the case, and the source works several. If H₀ says Navah’s climbing gear is safe, the Type II error, believing it might be safe when it is not, costs more, because she would then climb with it [4]. If H₀ says an accident victim is still alive on reaching the emergency room, the Type I error, thinking the victim dead when alive, is worse, because the crew will not treat them [5]. If H₀ says the Genetic Labs product does not change the sex of a baby, the Type I error is worse, because people would use the product in hopes of having a male [5]. If H₀ says an experimental drug cures at least 75% of men with prostate cancer, a Type II error does the most harm, because a patient who believes it “most likely” will let that influence the choice of treatment [6].

Which distribution, under which assumptions

The chapter uses three tests, each with conditions the source states [7]:

  • Mean, σ known (the z-test): a simple random sample; the population normally distributed or the sample “sufficiently large”; and σ known, “which, in reality, is rarely known” [7].
  • Mean, σ not known (the t-test): a roughly normal population, sampled by simple random sampling, the sample standard deviation standing in for σ; “if the sample size is sufficiently large, a t-test will work even if the population is not approximately normally distributed” [7].
  • Proportion: a simple random sample meeting the binomial conditions, n independent trials, n fixed in advance, each with two outcomes and the same success probability p; and np > 5 and nq > 5, so that the binomial is shaped like the normal. The sample proportion “can be approximated” by a normal distribution with μ = p and σ = √(pq/n), q = 1 − p [7].

Rare events and the p-value

The logic: assume a property of the population (the null hypothesis), then gather a random sample. “If the sample has properties that would be very unlikely to occur if the assumption is true, then you would conclude that your assumption about the population is probably incorrect.” The assumption “may or may not be true. But your sample data are real” [8]. The source’s illustration is a party basket said to hold one $100 bill among 200 bubbles: Didi draws first and gets the bill, probability 1/200 = 0.005, so Ali doubts what they were told [8].

The definition. “The p-value is the probability that, if the null hypothesis is true, the results from another randomly selected sample will be as extreme or more extreme as the results obtained from the given sample.” If the p-value is large, H₀ is kept; “the smaller the p-value, the more unlikely the outcome, and the stronger the evidence is against the null hypothesis” [8]. The chapter’s glossary puts it as “the probability that an event will happen purely by chance assuming the null hypothesis is true” [16].

A worked case. A baker says his loaves are over 15 cm tall on average; a sample of ten loaves averages 17 cm. From hundreds of earlier loaves he knows the heights are normal, with σ = 0.5 cm. H₀: μ ≤ 15, Hₐ: μ > 15. Under H₀, and because the heights are normal, a ten-loaf average is normally distributed, centered on 15, with standard deviation σ/√n = 0.5/√10 = 0.16, so the p-value, P(x̄ > 17) under the null, is approximately zero: a sample of ten loaves averaging at least 17 cm would almost never turn up by chance if the true average really were 15 cm [9].

Decision and conclusion

The p-value is then weighed against α, the significance level; α “is the probability of a Type I error” and is chosen before the data are collected; if none is given, “a common standard to use is α = 0.05” [10, 11]. Then [10]:

  • if the p-value is below α, H₀ is rejected and the results are significant, and “there is sufficient evidence to conclude that H₀ is an incorrect belief and that the alternative hypothesis, Hₐ, may be correct”;
  • if the p-value is α or more, H₀ is not rejected and the results are not significant;
  • not rejecting H₀ is no reason to believe it; it means only that the sample did not give enough evidence to doubt it seriously [10].

The source offers a rhyme, “If the p-value is low, the null must go. If the p-value is high, the null must fly” [11], and then a caution against using it mindlessly: an analyst should have more confidence in a rejection at p = 0.001 than at 0.04, and more confidence in a non-rejection at p = 0.4 than at 0.056, even with α = 0.05 in both cases; “this makes the data analyst use judgment rather than mindlessly applying rules” [11]. The chapter review adds the rule to carry away: “Never state that a claim is proven true or false”, because the test rests on probability and “we can talk only in terms of non-absolute certainties” [17].

Tails. The p-value is an area under the curve: on the left, on the right, or split between both ends; the alternative hypothesis says which, so Hₐ “is the key to conducting the appropriate test” [11]. Hₐ: μ < 5 is left-tailed, Hₐ: p > 0.2 right-tailed, Hₐ: p ≠ 0.5 two-tailed [12].

Three full tests from the chapter

z-test, left-tailed. Jeffrey’s 25-yard freestyle averaged 16.43 s with standard deviation 0.8 s; with new goggles, 15 swims averaged 16 s. H₀: μ = 16.43, Hₐ: μ < 16.43, α = 0.05, swim times assumed normal, σ known. The p-value, the chance of a mean of 16 s or less, is 0.0187: “if H₀ is true, there is a 0.0187 probability (1.87%) that Jeffrey’s mean time … is 16 seconds or less”, a rare event. Since α > p-value, reject H₀; with α at 5%, the data are enough to conclude that his mean time is under 16.43 s [13]. The source’s historical note gives the older form of the same decision: the test statistic z = (x̄ − μ)/(σ/√n) = −2.08 is compared with the critical value −1.645 for α = 0.05, and since −1.645 > −2.08, reject; “today, comparing the two probabilities α and the p-value is very common” [14]. The same example spells out both errors: Type I, concluding he swims faster when he does not; Type II, finding no evidence when he actually does [13].

z-test, right-tailed, not rejected. A coach records bench-press weights averaging 275 pounds with σ = 55; thirty players’ estimates average 286.2. H₀: μ = 275, Hₐ: μ > 275, α = 0.025. A p-value of 0.1323, a 13.23% chance, “is large enough”, so a sample mean of 286.2 or above would not be unusual; since the p-value exceeds α, H₀ stands, and with α at 2.5% the data do not show a true mean above 275 pounds [15].

Proportion, two-tailed, not rejected. Joon thinks half of all women marrying for the first time are younger than the man they marry; in a sample of 100 such brides, 53 are. The null is p = 0.50, the two-sided alternative p ≠ 0.50, and α = 0.01. With p′ = 53/100 = 0.53, the p-value counts both tails by symmetry, the chance of a sample proportion under 0.47 or over 0.53, and comes to 0.5485. Since the p-value exceeds α, “you cannot reject H₀”: with α at 1%, the sample does not show that the true share differs from 50% [18].

The source’s own closing caution on a test whose p-value of 0.0103 sat just above α = 0.01: “this test result is not very definitive since the p-value is very close to alpha”, and in reality one “would probably do more tests” [19].

What this article does not cover

Tests comparing two samples (the source’s chapter 10), confidence intervals, calculator procedures, the chapter’s practice problems, and any claim about how p-values are used or misused in published research, which these pages do not discuss.

Sources

Equations in this PDF are images; the formulas cited here were read from rendered pages 467, 468, 473 and 488.

  • [1]OpenStax, Introductory Statistics 2e, ch. 9, p. 461 (Introduction; the five steps, continued on p. 462). View at source ↗
  • [2]Same, §9.1, p. 462 (H₀ and Hₐ; the two decisions; Table 9.1 and the note on symbols). View at source ↗
  • [3]Same, §9.1, p. 463 (Examples 9.2, 9.3, 9.4). View at source ↗
  • [4]Same, §9.2, p. 464 (Table 9.2; α, β, power; Example 9.5). View at source ↗
  • [5]Same, §9.2, p. 465 (Examples 9.6 and 9.7). View at source ↗
  • [6]Same, §9.2, p. 466 (Example 9.8). View at source ↗
  • [7]Same, §9.3, pp. 466–467 (Table 9.3; “Assumptions”; np > 5 and nq > 5; μ = p, σ = √(pq/n), rendered; the same two formulas in the Formula Review, p. 488, rendered). View at source ↗
  • [8]Same, §9.4, p. 467 (“Rare Events”; the $100 bubble, 1/200 = 0.005; definition of the p-value). View at source ↗
  • [9]Same, §9.4, pp. 467–468 (Example 9.9, the baker; 0.5/√10 = 0.16, rendered; Figure 9.2). View at source ↗
  • [10]Same, §9.4, p. 468 (“Decision and Conclusion”). View at source ↗
  • [11]Same, §9.5, p. 469 (Example 9.10, the rhyme; α = 0.05 default; tails; judgment, not rules). View at source ↗
  • [12]Same, §9.5, pp. 470–471 (Examples 9.11 and 9.12; the two-tailed case from Try It 9.13, p. 471, because Example 9.13 on p. 470 prints p ≠ 50 while calling it a test of a mean). View at source ↗
  • [13]Same, §9.5, pp. 471–472 (Example 9.14, Jeffrey’s swims; Type I and II in context). View at source ↗
  • [14]Same, §9.5, p. 473 (Historical Note to Example 9.14; z = −2.08, critical value −1.645; formula rendered). View at source ↗
  • [15]Same, §9.5, pp. 473–474 (Example 9.15, bench press). View at source ↗
  • [16]Same, ch. 9 Key Terms, p. 486 (p-value; Level of Significance; Type I and II). View at source ↗
  • [17]Same, ch. 9 Chapter Review, pp. 486–487 (§9.1 points 3 and 4; §9.5 process). View at source ↗
  • [18]Same, §9.5, pp. 476–477 (Example 9.17, Joon’s brides, 0.5485). View at source ↗
  • [19]Same, §9.5, pp. 479–480 (Example 9.19, the flea shampoo, p-value 0.0103; the note on a result close to α). View at source ↗

Wikipedia was not used as a source.

Works cited