Lecture 16 — Hypothesis Testing (第16讲——假设检验)


1. Overview of Lecture 16 (第16讲概览)

Topics (主题)

  • Developing null & alternative hypotheses (构建原假设与备择假设)
  • Type I and Type II errors (第一类与第二类错误)
  • Population mean test with known using (已知 时用 检验总体均值)
  • One-tailed vs. two-tailed tests, -value, -score, confidence interval approach (单尾/双尾检验、p 值、z 分数与置信区间方法)

2. Purpose of Hypothesis Testing (假设检验的目的)

Idea (基本思想)

  • Decide whether to reject a statement about a population parameter using sample data.
  • 利用样本数据判断是否应当拒绝关于总体参数的陈述。

Population vs. Sample (总体与样本)

  • Population parameter is unknown; sample statistic provides evidence.
  • 总体参数未知,样本统计量提供证据。

3. Null & Alternative Hypotheses (原假设与备择假设)

Null Hypothesis (原假设 )

  • Baseline or “no effect / no difference” statement about a parameter.
  • 表示“无变化/无差异”的基准陈述。
  • Equality sign always belongs to (e.g., , , ).
  • 等号总写在 中,如

Alternative Hypothesis (备择假设 )

  • Research claim, opposite to (effect or difference exists).
  • 研究者真正关心的主张,与 相反,表示存在效应或差异。
  • Direction of (, , ) determines test type (one- or two-tailed).
  • 的方向()决定检验是单尾还是双尾。

Using Sample Data (利用样本数据)

  • Compute test statistic from sample and compare with distribution under .
  • 用样本计算检验统计量,再与 下的理论分布比较。

4. Supporting vs. Not Rejecting (支持 与不拒绝 )

Supporting (支持备择假设)

  • If sample result is very unlikely under , we reject and say data support .
  • 若样本结果在 为真时几乎不可能出现,就拒绝 ,认为数据支持

Not Rejecting (不拒绝原假设)

  • If sample result is plausible under , we “do not reject ”.
  • 若样本结果在 下很常见,则“不拒绝 ”。
  • “Do not reject” ≠ “prove true”; evidence is simply not strong enough.
  • “不拒绝”并不等于“证明 为真”,只表示证据不够强。

Example: Teaching Methods (教学方法示例)

  • (class B with new method better than A); .
  • 例:(新方法 B 班更好),

5. One-Tailed vs. Two-Tailed Tests (单尾检验与双尾检验)

One-Tailed Tests (单尾检验)

  • Concern only one direction (e.g., “greater than” or “less than”).

  • 只关心单一方向的变化(只关心“变大”或“变小”)。

  • Forms:

    • Lower-tail: ,
    • Upper-tail: ,

Two-Tailed Tests (双尾检验)

  • Detect any difference (either greater or less).
  • 检测“是否不同”,不区分方向。
  • Form: ,

Example: Bottle Sizes (瓶子大小示例)

  • One-tail: vs. (A not bigger than B).
  • 单尾例: 对比
  • Two-tail: vs. .
  • 双尾例: 对比

6. Type I & Type II Errors (第一类与第二类错误)

Why Errors Occur (为什么会出错)

  • Decisions are based on samples, not the whole population.
  • 决策基于样本而非总体,存在抽样误差与偏差。

Type I Error (第一类错误)

  • Reject when is actually true.
  • 真实时错误地拒绝
  • Probability of Type I error = significance level .
  • 第一类错误的概率就是显著性水平

Type II Error (第二类错误)

  • Do not reject when is false (i.e., is true).
  • 为假时仍然不拒绝
  • Probability denoted by ; affected by sample size and true effect size.
  • 表示,受样本量与真实效应大小影响。

Decision Table (决策表)

  • true + do not reject → correct decision.
  • 为真 + 不拒绝 → 正确决策。
  • true + reject → Type I error.
  • 为真 + 拒绝 → 第一类错误。
  • false + reject → correct decision.
  • 为假 + 拒绝 → 正确决策。
  • false + do not reject → Type II error.
  • 为假 + 不拒绝 → 第二类错误。

7. p-Value Concept (p 值的概念)

Definition (定义)

  • p-value: probability, assuming is true, of observing a test statistic at least as extreme as the sample’s.
  • p 值:在假定 为真时,观察到当前或更极端检验统计量的概率。

Decision Rule (决策规则)

  • If , reject and support .
  • ,拒绝 ,支持
  • If , do not reject .
  • ,则不拒绝

Evidence Strength (证据强度)

  • → very strong evidence for .
  • → 支持 的证据非常强。
  • → strong evidence.
  • → 证据强。
  • → acceptable evidence.
  • → 证据尚可。
  • → insufficient evidence.
  • → 证据不足。

Graph Example (图形示例)

  • Left-tail: is shaded area beyond observed ; compare with .
  • 左尾例:p 值为观测 z 左侧阴影面积,与 比较。

8. z-Score Approach (z 分数方法)

Relationship to p-Value (与 p 值的关系)

  • Each from standard normal has a corresponding tail probability .
  • 标准正态中的每个 z 都对应一个尾部概率 p。
  • Two-tailed: reject if .
  • 双尾检验:若 则拒绝
  • One-tailed: reject if (upper) or (lower).
  • 单尾检验:右尾 ,左尾 时拒绝

Critical Values (临界值)

  • Common two-tailed:

    • :
    • :
    • :
  • 常用双尾临界值如上。

  • Common one-tailed:

    • :
    • :
    • :

Evidence Interpretation (证据含义)

  • Smaller p ↔ larger beyond critical value → stronger evidence against .
  • p 越小、 超过临界值越多 → 反对 的证据越强。

Example (示例)

  • Two-tailed, : gives p ≈ 0.0062 < 0.05 → reject .
  • 例:双尾 α=0.05 时, 对应 p≈0.0062,小于 0.05,应拒绝

9. z-Test Procedure for Mean (σ Known) (已知 σ 的均值 z 检验步骤)

Step 1 — Set Hypotheses (步骤1——写出假设)

  • Choose and based on research question and direction.
  • 根据问题及方向写出

Step 2 — Choose α & Tail Type (步骤2——选定 α 与尾部)

  • Select significance level α (e.g., 0.10, 0.05, 0.01) and decide one- or two-tailed.
  • 选显著性水平 α,并决定是单尾还是双尾检验。

Step 3 — Compute z-Value (步骤3——计算 z 值)

  • Use formula .
  • 用公式 计算 z。

Step 4 — Find Critical Value(s) (步骤4——求临界值)

  • Use α to get (one-tail) or (two-tail).
  • 利用 α 查表或用软件得到

Step 5 — Make Decision (步骤5——作出决策)

  • Compare with critical value(s) or compare p with α; decide reject / not reject .
  • 比较 z 与临界值或 p 与 α,决定是否拒绝

10. Example: 12-Minute Time Goal (12 分钟目标示例)

Problem Setup (问题设定)

  • Population , , goal: mean time minutes.
  • 总体标准差 3.2,样本量 40,目标是平均时间不超过 12 分钟。
  • , (upper-tail test).
  • ,为右尾检验。

Case 1: (样本均值 13.25)

  • , p = 0.0068 < 0.05, → reject .
  • ,p=0.0068<0.05 且 → 拒绝 ,目标未达成。

Case 2: (样本均值 12.5)

  • , p = 0.1611 > 0.05, → do not reject .
  • ,p=0.1611>0.05 且 → 不拒绝 ,目标可视为达成。

11. Confidence Interval Approach (置信区间方法)

Idea (核心思想)

  • Build a confidence interval for : .
  • 构造 的总体均值置信区间:

Decision Rule (决策规则)

  • If CI contains → do not reject .
  • 若置信区间包含 → 不拒绝
  • If CI does not contain → reject .
  • 若置信区间不包含 → 拒绝

Example with Two Samples (两个样本的例子)

  • For : CI = (12.26, 14.24), does not contain 12 → reject .
  • 对于 :区间 (12.26, 14.24) 不包含 12 → 拒绝
  • For : CI = (11.51, 13.49), contains 12 → do not reject .
  • 对于 :区间 (11.51, 13.49) 包含 12 → 不拒绝
  • CI and z-test at same α always give the same decision.
  • 相同 α 下,置信区间法与 z 检验的结论完全一致。

12. Summary of Lecture 16 (第16讲小结)

Key Takeaways (关键要点)

  • Hypothesis testing compares and using sample evidence.
  • 假设检验用样本证据在 之间作出判断。
  • Choice of one- vs. two-tailed test depends on research question direction.
  • 单尾或双尾检验由研究问题的方向决定。
  • Errors (Type I & II) are unavoidable; α controls Type I error.
  • 第一、二类错误难以完全避免,α 控制第一类错误概率。
  • p-value, z-score, and confidence interval are three equivalent ways to make decisions.
  • p 值、z 分数与置信区间是三种等价的决策工具。