4.18 Hypothesis testing: means, proportions, correlation and errors

4.18 Hypothesis testing: means, proportions, correlation and errors

IB Maths: Applications and Interpretation HL: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Hypotheses are about the population parameter, never the sample statistic. If p<αp<\alpha, reject H0\mathrm{H}_0.
  • Never conclude H0\mathrm{H}_0 is proved: say "insufficient evidence to reject".
  • σ\sigma known: zz-test. σ\sigma unknown: tt-test with n−1n-1 degrees of freedom. Paired data: test the differences.
  • Binomial and Poisson tests are one-tailed in IB; the critical region has probability below α\alpha.
  • A Type I error rejects a true H0\mathrm{H}_0; a Type II error fails to reject a false one.

The language of a test

State hypotheses about the population, find the pp-value, compare with α\alpha and conclude cautiously in context.

The null hypothesis H0\mathrm{H}_0 states a parameter equals a value (for example μ=500\mu=500). The alternative hypothesis H1\mathrm{H}_1 is ≠\ne (two-tailed) or << / >> (one-tailed).

The significance level α\alpha is the probability of rejecting H0\mathrm{H}_0 when it is true. The pp-value is the probability, if H0\mathrm{H}_0 is true, of a result at least as extreme as the one observed. If p<αp<\alpha, reject H0\mathrm{H}_0. For a two-tailed test, double the tail probability.

The critical region is the set of test statistics that lead to rejection; its boundary is the critical value.

−4−3−2−112340.10.20.30.4xyz = -1.645Distribution under H0
One-tailed test at 5%5\% (lower tail): the shaded critical region is z<−1.645z<-1.645.
  1. 1

    State hypotheses

    H0 and H1 about the population

  2. 2

    Choose the level

    significance level alpha

  3. 3

    Find the p-value

    under H0, using the GDC

  4. 4

    Compare

    reject H0 if p < alpha

  5. 5

    Conclude in context

    cautious wording

Steps of a hypothesis test

A test at the 5%5\% level gives p=0.08p=0.08. What is the correct conclusion?

Tests for a population mean

Use a zz-test when σ\sigma is known and a tt-test when it is not; for paired data test the differences.

σ\sigma known (normal population, or large nn): under H0\mathrm{H}_0, Xˉ∼N(μ0,σ2n)\bar X\sim N\left(\mu_0,\frac{\sigma^2}{n}\right), so use the zz-test.

σ\sigma unknown: use the one-sample tt-test with n−1n-1 degrees of freedom, whatever the sample size. The GDC gives tt and the pp-value.

Matched pairs: take the differences d=x1−x2d=x_1-x_2 as a single sample and test H0:μd=0\mathrm{H}_0:\mu_d=0. Unpaired samples are independent.

−4−3−2−112340.10.20.30.4xyz = −1.95N(0, 1)
Standard normal curve: z = −1.95 for the worked example; the shaded left tail is the p-value, 0.0256.

z-test

When:
σ known (or large n)
Distribution:
Normal
Degrees of freedom:
Not needed

t-test

When:
σ unknown
Distribution:
t-distribution
Degrees of freedom:
n − 1

Worked example

μ0=500\mu_0=500, σ=8\sigma=8, n=36n=36, xˉ=497.4\bar x=497.4, H1:μ<500\mathrm{H}_1:\mu<500. Test at the 5%5\% level.

The population standard deviation is unknown and n=15n=15. Which test is used?

Proportions and Poisson means

Use the binomial or Poisson distribution under H0\mathrm{H}_0, and find P(X≥x)\mathrm{P}(X\ge x) or P(X≤x)\mathrm{P}(X\le x).

Proportion: H0:p=p0\mathrm{H}_0:p=p_0. Poisson mean: H0:λ=λ0\mathrm{H}_0:\lambda=\lambda_0, rescaled to the period observed.

For H1:p>p0\mathrm{H}_1:p>p_0 the pp-value for observing xx is P(X≥x)=1−P(X≤x−1)\mathrm{P}(X\ge x)=1-\mathrm{P}(X\le x-1).

These tests are one-tailed only in IB.

The critical region for a discrete variable is found by testing values: choose the region with the largest probability still less than the significance level.

Example: n=25n=25, p0=0.3p_0=0.3, x=12x=12 gives p=0.0442<0.05p=0.0442<0.05, so reject H0\mathrm{H}_0.

00.050.10.150.20.00390.00680.0008891011121314151617181920xP(X = x)
Probabilities for X ~ B(20, 0.7): the lower tail X ≤ 10 adds to 0.0480, so the critical region is X ≤ 10.

Proportion

Null hypothesis:
p = p₀
Distribution under H0:
B(n, p₀)
p-value when H1 is "greater":
P(X ≥ x)

Poisson mean

Null hypothesis:
λ = λ₀
Distribution under H0:
Po(λ₀)
p-value when H1 is "greater":
P(X ≥ x)

Worked example

X∼B(20,0.7)X\sim\mathrm{B}(20,0.7) under H0\mathrm{H}_0 and H1:p<0.7\mathrm{H}_1:p<0.7. Find the critical region at the 5%5\% level.

For H1:p>p0\mathrm{H}_1:p>p_0 and an observed value x=12x=12, which probability is the pp-value?

Type I and Type II errors

Type I rejects a true H0\mathrm{H}_0; Type II fails to reject a false one.

A Type I error is rejecting H0\mathrm{H}_0 when it is true. Its probability is that of the critical region under H0\mathrm{H}_0: α\alpha for continuous tests, but for discrete tests the actual probability, which may be below α\alpha (for example 0.04800.0480).

A Type II error is not rejecting H0\mathrm{H}_0 when it is false. Its probability is found under a specific true value of the parameter: P(statistic not in the critical region∣true value)\mathrm{P}(\text{statistic not in the critical region}\mid\text{true value}).

4934944954964974984995005015025035040.050.10.150.20.250.30.35xycritical value 497.8H₀: μ = 500True μ = 497
Sampling distributions of the mean (σ/√n = 8/6): H₀ centred on 500, true mean 497. The shaded part of the true curve right of 497.8 is the Type II error, 0.273.

H0 is true

Reject H0:
Type I error
Do not reject H0:
Correct decision

H0 is false

Reject H0:
Correct decision
Do not reject H0:
Type II error

Worked example: normal

σ=8\sigma=8, n=36n=36, H0:μ=500\mathrm{H}_0:\mu=500, H1:μ<500\mathrm{H}_1:\mu<500 at 5%5\%. Find P(Type II)\mathrm{P}(\text{Type II}) if the true μ=497\mu=497.

A medical test fails to detect a disease that the patient has. Which error is this, if H0\mathrm{H}_0 is that the patient is healthy?

Testing for correlation

Test H0:ρ=0\mathrm{H}_0:\rho=0 with technology; a small pp-value is evidence of correlation, not causation.

For data from a bivariate normal population, the sample product-moment correlation coefficient rr estimates the population coefficient ρ\rho.

Test H0:ρ=0\mathrm{H}_0:\rho=0 against H1:ρ≠0\mathrm{H}_1:\rho\ne0 (or ρ>0\rho>0, ρ<0\rho<0). Use technology; in examinations the data or output will be given.

If p<p< the significance level, reject H0\mathrm{H}_0: there is sufficient evidence of a linear correlation. Example: r=0.78r=0.78, p=0.004p=0.004 at 5%5\%.

  1. 1

    State the hypotheses

    H₀: ρ = 0 against H₁: ρ ≠ 0 (or ρ > 0, ρ < 0)

  2. 2

    Use technology

    get r and the p-value, e.g. r = 0.78, p = 0.004

  3. 3

    Compare p with α

    p < α: reject H₀

  4. 4

    Conclude in context

    evidence of a linear correlation, not causation

Testing for correlation.
  • HypothesesH0:ρ=0\mathrm{H}_0:\rho=0 against H1:ρ≠0\mathrm{H}_1:\rho\ne0
  • Decisionp<αp<\alpha: evidence of correlation

A correlation test gives r=0.78r=0.78 with p=0.004p=0.004 at the 5%5\% level. What is the conclusion?

Try an exam question

A coin is claimed to be fair. To test whether it is biased towards heads it is tossed 2020 times and gives 1515 heads. Test at the 5%5\% significance level.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Which of the following are the correct hypotheses for the inspector's test?

1 mark, marked against the mark scheme

Revision notes