跳到主要内容

Statistical hypothesis testing

AQA A-Level 数学知识点 15

本主题的视频课程 打开视频页面
6:53

Statistical hypothesis testing

每次假设检验都遵循相同的五个步骤。在看到数据之前,先陈述关于总体参数的原假设和备择假设。写出原假设成立时所遵循的模型。求出结果至少与观察结果一样极端的概率。把它与显著性水平比较。然后结合情境作出结论,绝不声称已经证明了什么。

英文讲解 · 可切换中英文字幕

15.1

范围与先修条件

English

AQA A-level Mathematics 7357, section O (Statistical hypothesis testing), version 1.3 (first assessment 2018). Original teaching notes.

Prerequisites: the binomial and normal models from section N, and correlation from section L.

These are original teaching examples, not official AQA material.

词汇 训练
English 中文 拼音
statistical hypothesis testing/stəˈtɪstɪkl haɪˈpɒθəsɪs ˈtestɪŋ/ 假设检验 jiǎ shè jiǎn yàn
15.2

统计假设检验 假设检验

English

Is it just luck?

A factory says that 10% of its parts are faulty. A customer checks 10 parts and finds 3 faulty ones. That is 30%, not 10%. Is the factory wrong, or was the customer just unlucky? A hypothesis test answers this with probability. It asks: if the claim were true, how unusual would this result be? If the result would be very unusual, we have evidence against the claim.

Randomisation underpins fair comparison of two groups in a mean difference test
Randomisation underpins fair comparison of two groups in a mean difference test

The words of testing

Term Meaning
Null hypothesis 原假设 $H_0$ the default claim, such as $p=0.1$
Alternative hypothesis 备择假设 $H_1$ what we look for evidence of, such as $p>0.1$
Test statistic 检验统计量 the number from the sample that we test, such as the number of faulty parts $X$
Significance level 显著性水平 how unusual a result must be before we reject $H_0$, such as 5%
Critical region 拒绝域 the values of the test statistic that lead us to reject $H_0$
Critical value 临界值 the first value inside the critical region
Hypotheses about the population, the test statistic from the sample, the significance level setting the critical region, and the decision to reject or not
The words of testing in order

The hypotheses are always about the population parameter ($p$ or $\mu$), never about the sample. And you write them before you look at the data.

The five steps

  1. State $H_0$ and $H_1$, using the parameter.
  2. State the distribution of the test statistic if $H_0$ is true.
  3. Find the probability of a result at least as extreme as the one observed (the p-value p值), or find the critical region.
  4. Compare with the significance level.
  5. Write a conclusion in context, with no certainty.

A binomial test

Worked example. The factory claim: $p=0.1$. The customer finds 3 faulty parts in 10. Test at the 5% level whether the rate is higher.

$$H_0:p=0.1,\qquad H_1:p>0.1.$$

If $H_0$ is true, $X\sim B(10,0.1)$. The result 3 is in the upper tail, so find $P(X\ge3)$:

$$P(X\ge3)=1-P(X\le2)=1-0.9298=0.0702.$$

$0.0702>0.05$, so the result is not in the critical region. Do not reject $H_0$. There is insufficient evidence, at the 5% level, that more than 10% of parts are faulty.

Left: three steps of a test, ending 0.0702 > 0.05. Right: B(10, 0.1) with the tail P(X ≥ 3) ≈ 0.0702 shaded
P(X ≥ 3) ≈ 0.0702 > 0.05, so there is insufficient evidence to reject H₀, which does not prove H₀

Common mistake. Finding $P(X=3)=0.0574$. The test needs the whole tail, “3 or more”, because a result of 4 or 5 would be even stronger evidence.

Writing the conclusion. A good conclusion has three parts: the decision, the level, and the context.

Weak Strong
“$H_0$ is true.” “Do not reject $H_0$. There is insufficient evidence at the 5% level that the rate of faulty parts is above 10%.”
“Reject $H_0$.” “Reject $H_0$. There is evidence at the 5% level that the rate of faulty parts is above 10%.”

Never write that a test proves anything. A test only weighs evidence.

One tail or two?

Read $H_1$ from the question's words:

Words in the question $H_1$ Test
“has increased”, “is higher” $p>0.3$ one-tailed test 单尾检验, upper tail
“has decreased”, “is lower” $p<0.3$ one-tailed, lower tail
“has changed”, “is different” $p\ne0.3$ two-tailed test 双尾检验

In a two-tailed test at the 5% level, put 2.5% in each tail. Then compare each tail probability with 0.025.

Finding a critical region

Worked example: one tail. $X\sim B(20,0.3)$. Test $H_0:p=0.3$ against $H_1:p<0.3$ at the 5% level. Find the critical region.

Look down the cumulative table for the lower tail:

$k$ 1 2 3 4
$P(X\le k)$ 0.0076 0.0355 0.1071 0.2375

$P(X\le2)=0.0355\le0.05$, but $P(X\le3)=0.1071>0.05$. So the critical region is $X\le2$.

The actual significance level 实际显著性水平 is $P(X\le2)=0.0355$, or 3.55%. It is below 5% because the binomial is discrete: there is no region with a probability of exactly 5%. The actual level is the true probability of rejecting $H_0$ when it is true.

Worked example: two tails. The same $X$, but $H_1:p\ne0.3$ at the 10% level, so 5% in each tail.

  • Lower tail: $P(X\le2)=0.0355\le0.05$ and $P(X\le3)=0.1071$, so $X\le2$.
  • Upper tail: $P(X\ge10)=1-P(X\le9)=1-0.9520=0.0480\le0.05$, and $P(X\ge9)=1-0.8867=0.1133$, so $X\ge10$.

The critical region is $X\le2$ or $X\ge10$. The actual significance level is $0.0355+0.0480=0.0835$.

A bar chart of the binomial distribution B 20, 0.3, with the bars for x up to 2 and x from 10 upward coloured as the critical region, of probability 0.0355 and 0.0480, an actual significance level of 0.0835
The two-tailed critical region for B(20, 0.3) at the 10% level

Common mistake. For the upper tail, “$X\ge10$” is $1-P(X\le9)$, not $1-P(X\le10)$.

Testing a normal mean

When the population is normal, $X\sim N(\mu,\sigma^2)$ with known $\sigma$, the sample mean of $n$ values has a smaller spread:

$$\bar X\sim N\!\left(\mu,\frac{\sigma^2}n\right).$$

A bigger sample gives a narrower distribution, so it can detect smaller changes.

Worked example. Bags of rice have masses $N(50,5^2)$ grams. After a change to the machine, a sample of 25 bags has mean $\bar x=51.8$. Test at the 5% level whether the mean has increased.

$$H_0:\mu=50,\qquad H_1:\mu>50.$$

If $H_0$ is true, $\bar X\sim N\!\left(50,\frac{5^2}{25}\right)=N(50,1^2)$.

  • Using the p-value: $P(\bar X\ge51.8)=P(Z\ge1.8)=0.0359<0.05$.
  • Using the critical value: $50+1.6449\times1=51.64$, and $51.8>51.64$.

Both say the same: reject $H_0$. There is evidence at the 5% level that the mean mass has increased.

Left: bar chart of B(20, 0.3) with the two-tailed critical region X ≤ 2 (0.0355) and X ≥ 10 (0.0480) shaded. Right: the curve N(50, 1²) for the sample mean with the upper 5% region beyond 51.64 shaded and the observed mean 51.8 inside it
A binomial critical region rarely holds exactly 5%: here the two tails hold 8.35%; the sample mean 51.8 lies beyond 51.64, so H₀ is rejected

Common mistake. Standardising with $\sigma=5$ instead of $\frac\sigma{\sqrt n}=1$. The test is about the sample mean, so use its own standard deviation.

Testing a correlation

The correlation coefficient 相关系数 $r$ of a sample estimates the population value $\rho$. You test whether there is any correlation in the population:

  • $H_0:\rho=0$ (no correlation);
  • $H_1:\rho>0$, $\rho<0$ or $\rho\ne0$, from the question's words.

Compare $r$ with the critical value from the table for the sample size $n$.

Worked example. For 20 students, revision time and test mark have $r=0.52$. Test at the 5% level for positive correlation. The table gives 0.3783 for $n=20$, one tail. $0.52>0.3783$, so reject $H_0$. There is evidence at the 5% level of positive correlation between revision time and mark in the population.

What a test can and cannot say

  • Not rejecting $H_0$ does not prove it. The sample may be too small to show a real change.
  • At the 5% level, a true $H_0$ is still rejected about 5% of the time (or the actual level, for a binomial test). This is the risk you accept.
  • “Significant” means unlikely by chance, not “large” or “important”. A tiny change can be significant in a very large sample.

Traps

Slip Fix
$H_0:\hat p=0.3$ or $H_0:\bar x=50$ use the population parameter: $p$ or $\mu$
testing $P(X=3)$ test the tail: $P(X\ge3)$
a two-tailed test against 5% in one tail 2.5% in each tail
“$H_0$ is proved” “insufficient evidence to reject $H_0$”
$\sigma$ used for $\bar X$ $\frac\sigma{\sqrt n}$

Practice

  1. Write $H_0$ and $H_1$: a coin is tested to see if it is biased towards heads.
  2. $X\sim B(12,0.35)$, $H_1:p>0.35$, and 8 successes are seen. Test at the 5% level.
  3. $X\sim B(20,0.5)$, $H_1:p\ne0.5$, at the 5% level. Find the critical region and the actual significance level. Use $P(X\le5)=0.0207$ and $P(X\le6)=0.0577$.
  4. Masses are $N(\mu,6^2)$. A sample of 16 has $\bar x=52.3$. Test $H_0:\mu=50$ against $H_1:\mu>50$ at the 5% level.
  5. For 20 cities, $r=-0.41$ between temperature and heating cost. Test for negative correlation at the 5% level (critical value 0.3783).
  6. A test gives a p-value of 0.12. A student writes “so $H_0$ is true”. Correct the statement.

Answers.

  1. $H_0:p=0.5$, $H_1:p>0.5$, where $p$ is the probability of a head.
  2. $P(X\ge8)=1-P(X\le7)=0.0255<0.05$: reject $H_0$; there is evidence that $p>0.35$.
  3. By symmetry, $X\le5$ or $X\ge15$; actual level $2\times0.0207=0.0414$.
  4. $\bar X\sim N(50,1.5^2)$, $z=1.53$, $P(Z\ge1.53)=0.063>0.05$: do not reject $H_0$; insufficient evidence that the mean has increased.
  5. $-0.41<-0.3783$: reject $H_0$; there is evidence of negative correlation.
  6. “There is insufficient evidence to reject $H_0$.” The test cannot show that $H_0$ is true.

Key points

  • Hypotheses use the population parameter and are written before the data are seen.
  • Test the whole tail at least as extreme as the result, under $H_0$.
  • Two-tailed: half the significance level in each tail.
  • Binomial critical regions: the actual significance level is the true tail probability, often below the nominal level.
  • For a normal mean, $\bar X\sim N\!\left(\mu,\frac{\sigma^2}n\right)$.
  • Conclude in context, with no certainty: “evidence” or “insufficient evidence”.
探索

假设检验与情境结论

在观察结果之前,使用总体参数陈述H₀和H₁。

对比模型与已解案例,并说明其中一处变化。

词汇 训练
English 中文 拼音
null hypothesis/nʌl haɪˈpɒθəsɪs/ 原假设 yuán jiǎ shè
alternative hypothesis/ɔːlˈtɜːnətɪv haɪˈpɒθəsɪs/ 备择假设 bèi zé jiǎ shè
test statistic/test stəˈtɪstɪk/ 检验统计量 jiǎn yàn tǒng jì liàng
significance level/sɪɡˈnɪfɪkəns ˈlevl/ 显著性水平 xiǎn zhù xìng shuǐ píng
critical region/ˈkrɪtɪkl ˈriːdʒn/ 拒绝域 jù jué yù
critical value/ˈkrɪtɪkl ˈvæljuː/ 临界值 lín jiè zhí
p-value/piː ˈvæljuː/ p值 p zhí
one-tailed test/wʌn teɪld test/ 单尾检验 dān wěi jiǎn yàn
two-tailed test/tuː teɪld test/ 双尾检验 shuāng wěi jiǎn yàn
actual significance level/ˈæktʃuːəl sɪɡˈnɪfɪkəns ˈlevl/ 实际显著性水平 shí jì xiǎn zhù xìng shuǐ píng
correlation coefficient/ˌkɒrɪˈleɪʃn ˌkəʊɪˈfɪʃənt/ 相关系数 xiāng guān xì shù

该知识点的互动课程

逐步完成,配合即时检查练习。

更多 AQA A-Level 数学 知识点

登录或创建账户

IGCSE, A-Level & AP