Menu
Sign up Sign in

AI SL · 13.4

Hypothesis Testing

13.4.1

What a hypothesis test is

13.4.1

What a hypothesis test is

Target: I can write the null hypothesis H0 and the alternative hypothesis H1 for a population mean from a context. (+3 more)

By the end of this section

Key points

The two hypotheses

  • The null hypothesis \(H_0\) is the default claim. You keep it unless the data give strong evidence against it.
  • The alternative hypothesis \(H_1\) says how the claim may have changed.
  • For a mean, write both with the same symbol: \(H_0: \mu = 800\) and \(H_1: \mu < 800\). \(H_0\) always uses "=".
  • Take the old value in \(H_0\) from the context. Do not use the sample mean.

One tail or two

  • "Higher", "increased", "longer": \(H_1\) uses \(>\). One-tailed (upper tail).
  • "Lower", "decreased", "shorter": \(H_1\) uses \(<\). One-tailed (lower tail).
  • "Different", "changed": \(H_1\) uses \(\neq\). Two-tailed.
  • Decide the tails from the question, before you look at the data.

Significance level and p-value

  • The significance level \(\alpha\) is the probability small enough to count as strong evidence against \(H_0\). It is usually 5% or 1%.
  • The p-value is the probability, assuming \(H_0\) is true, of a result as extreme as the one observed or more extreme.
  • If \(p < \alpha\): reject \(H_0\). There is sufficient evidence for \(H_1\).
  • If \(p \geq \alpha\): do not reject \(H_0\). There is insufficient evidence for \(H_1\). This does not prove \(H_0\) true.
  • Write the conclusion in the words of the context, not just "reject \(H_0\)".

Explore: the p-value and the critical value

The p-value is an area under the curve of the test statistic, if H₀ is true. Choose the test and H₁, then drag the orange point to the value of the statistic. The gold area is α.

Significance level, α
Critical value
p-value

Drag the point with the mouse or a finger, or select it (Tab) and use the arrow keys. Type a value for an exact one.

Drag the point to choose the test statistic.

  1. Drag the statistic further from the middle. What happens to the p-value? Why is a statistic far out strong evidence against H₀?
  2. Press "Move to the critical value". What is the p-value? Compare it with α.
  3. Change H₁ from > to ≠ and keep the statistic. Why does the p-value double? Where is the other half of the area?
  4. In χ², keep χ² = 9 and increase the degrees of freedom. What happens to the p-value and to the critical value?

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
Hypotheses for a lower mean

A bakery says its loaves have a mean mass of 800 g. A customer thinks the loaves are lighter. Write \(H_0\) and \(H_1\) for the mean mass \(\mu\) and say whether the test is one-tailed or two-tailed.

Working
  1. H0

    \(H_0: \mu = 800\)

    The bakery's claim is the default. H0 uses an equals sign.

  2. H1

    \(H_1: \mu < 800\)

    The customer thinks the loaves are lighter, so the mean is lower.

  3. Tails

    One-tailed (lower tail)

    H1 goes one way only, so there is one tail.

Video walkthrough coming
Hypotheses for a changed mean

The mean time for pupils to run 100 m is 14.2 s. After a new training scheme a teacher wants to know whether the mean time has changed. Write \(H_0\) and \(H_1\) and say how many tails the test has.

Working
  1. H0

    \(H_0: \mu = 14.2\)

    The old mean is the default.

  2. H1

    \(H_1: \mu \neq 14.2\)

    The teacher asks only whether it has changed, not which way.

  3. Tails

    Two-tailed

    A change could be an increase or a decrease: two tails.

Video walkthrough coming
How extreme is 16 heads?

A coin is flipped 20 times and lands heads 16 times. The bar chart shows the number of heads in 1000 sets of 20 flips of a fair coin, found by simulation. Add up the bars for 16 or more heads. Is 16 heads an extreme result for a fair coin?

−112345678910111213141516171819202150100150200Number of heads in 20 flipsNumber of sets (out of 1000)
Working
  1. Read the bars

    16 or more heads: 5 + 1 = 6 sets

    Add every bar from 16 to the right. Bars of height 0 add nothing.

  2. Make a probability

    6 ÷ 1000 = 0.006

    Under the fair-coin model this result, or one more extreme, happens in about 0.6% of sets.

  3. Judge

    Extreme

    Under 1% is very rare. 16 heads is strong evidence against a fair coin.

Video walkthrough coming
p-value against significance level

The bakery in the first example weighs a sample of loaves. The test gives a p-value of 0.034 and the significance level is 5%. Write the conclusion in context.

Working
  1. Compare

    p = 0.034 < α = 0.05

    A small p-value means the sample is unlikely if the mean really is 800 g.

  2. Decision

    Reject \(H_0\)

    p is below the significance level.

  3. In context

    There is sufficient evidence, at the 5% level, that the mean mass of the loaves is less than 800 g.

    Say what it means for the bakery.

Video walkthrough coming