FH02 · REFERENCE SHEET

假设检验公式总表 Hypothesis Testing Formula Sheet

从“估计值减去原假设值”这条主线,串起 t 检验、p 值、置信区间、功效、比例与卡方检验。自上而下重要度递减:先掌握判断逻辑,再选具体检验。 Follow one backbone—estimate minus null value—through t tests, p-values, confidence intervals, power, proportions, and chi-square work. Importance drops down the page: own the decision logic first, then choose the test.

决策链Decision chain
H0 → p
证据,不是证明evidence, not proof
T1

必背 · 统计决策的骨架 Memorize · The Statistical Decision Backbone

5 张核心卡5 core cards
T1-1

检验统计量通用框架General Test-Statistic Framework

F16 深潜 →F16 deep dive →
T = (θ̂θ0) / SE(θ̂)

读作:信号(估计减假设)除以噪声(标准误)。Read it as: Signal—the estimate minus the null value—divided by noise, its standard error.

  • θ̂ / θ0 样本估计/原假设值sample estimate / null-hypothesis value
  • SE 估计量的标准误standard error of that estimator
何时用:Use it when: 理解各种参数检验为何只是同一信噪比框架的不同版本。You want to see every parametric test as a version of the same signal-to-noise ratio.
✗ 只看样本差值大小就下结论 → ✓ 用标准误把差值按抽样噪声标准化。✗ Decide from the raw sample difference alone → ✓ Scale the difference by its sampling noise through SE.
T1-2

单样本 t 检验One-Sample t Test

F16 深潜 →F16 deep dive →
t = (x̄ − μ0) / (s/√n)  ;  df = n − 1

读作:样本均值离假设值差几个标准误。Read it as: How many standard errors the sample mean sits away from the hypothesized mean.

  • μ0 原假设中的总体均值population mean stated by the null hypothesis
  • s/√n 样本均值的估计标准误estimated standard error of the sample mean
何时用:Use it when: 总体 σ 未知,用一个样本检验总体均值是否等于 μ0Population σ is unknown and one sample must test whether the population mean equals μ0.
✗ 总体 σ 未知时仍用 z 检验 → ✓ 用样本 s 与 t 分布,并采用 df = n − 1。✗ Use a z test when population σ is unknown → ✓ Use sample s and the t distribution with df = n − 1.
T1-3

p 值判定p-Value Decision Rule

F14 深潜 →F14 deep dive →
p < αH0

读作:若 H₀ 为真,出现"至少这么极端"数据的概率。Read it as: Assuming H₀ is true, the chance of seeing data at least this extreme.

  • p H0 为真时,看到至少这么极端数据的概率probability, assuming H0, of data at least this extreme
  • α 预先设定的显著性水平significance threshold set before looking at the result
何时用:Use it when: 按照预设 α 把样本证据转化为是否拒绝 H0 的决定。You need to turn sample evidence into a reject-or-not-reject decision against a preset α.
✗ p = 0.06 就说“证明了没差异” → ✓ 只能说“证据不足以拒绝 H0”。✗ Say p = 0.06 “proves there is no difference” → ✓ Say the evidence is insufficient to reject H0.
T1-4

两类错误与功效Two Error Types and Power

F15 深潜 →F15 deep dive →
α = P(T ∈ C | H0)  ;  β = P(T ∉ C | H1)
1 − β

读作:误报的概率、漏检的概率,和抓到真差异的本事。Read it as: The false-alarm rate, the miss rate, and the power to catch a real difference.

  • α 拒真的第一类错误概率Type I error: rejecting a true null
  • β 取伪的第二类错误概率Type II error: failing to reject a false null
  • C 拒绝域rejection region
何时用:Use it when: 在检验前平衡误报风险、漏报风险与发现真实差异的能力。You must balance false alarms, misses, and the ability to detect a real difference before collecting data.
✗ 只把 α 调小,却不检查功效 → ✓ 同时评估 β、效应量与样本量。✗ Tighten α without checking power → ✓ Evaluate β, effect size, and sample size together.
T1-5

置信区间通式General Confidence Interval

F14 深潜 →F14 deep dive →
θ̂ ± tα/2,df × SE(θ̂)
μ0 ∈ CI ⇔ p ≥ α

读作:点估计,加减几个标准误的安全边际。Read it as: The point estimate, plus or minus a safety margin measured in standard errors.

  • tα/2,df 双侧 t 临界值two-sided critical t value
  • θ̂ ± margin 点估计加减误差界限point estimate plus or minus its margin of error
何时用:Use it when: 同时表达估计值、精度,并与双侧检验结论相互校验。You need the estimate and its precision, with a direct cross-check against a two-sided test.
✗ 把 95% CI 解释为参数有 95% 概率在本区间内 → ✓ 解释为重复抽样时 95% 的同法区间会覆盖真值。✗ Say a fixed 95% CI has a 95% probability of containing the parameter → ✓ Say the procedure covers the true value in 95% of repeated samples.
T2

常用 · 按数据结构选检验 Working Set · Match the Test to the Data Structure

6 张常用卡 6 working cards
T2-6

两样本 t(等方差) Two-Sample t Test, Equal Variances

F17 深潜 → F17 deep dive →
sp 2 = [(n1−1)s1 2 + (n2−1)s2 2]/(n1+n2−2)
t = (x̄1 − x̄2) / [sp·√(1/n1 + 1/n2)]  ;  df = n1+n2−2
[(n1−1)s12 + (n2−1)s22]/(n1+n2−2)两个样本方差按自由度加权Weight the two sample variances by their degrees of freedom sp·√(1/n1 + 1/n2)合成标准误Combined standard error
  • sp 2 两组的合并方差 pooled variance across the two groups
  • n1, n2 两组样本量 sample sizes of the two groups
何时用: Use it when: 比较两个独立均值,并有理由采用等方差假设。 You are comparing two independent means and have a defensible equal-variance assumption.
T2-7

Welch t(不等方差) Welch t Test, Unequal Variances

F17 深潜 → F17 deep dive →
t = (x̄1 − x̄2) / √(s1 2/n1 + s2 2/n2)
df ≈ νWS
  • s1 2, s2 2 各组独立估计的方差 variance estimated separately in each group
  • df Welch–Satterthwaite 近似自由度 Welch–Satterthwaite approximate degrees of freedom
何时用: Use it when: 比较两个独立均值,但方差不等或样本量不平衡。 You are comparing two independent means with unequal variances or unbalanced sample sizes.
T2-8

配对 t Paired t Test

F17 深潜 → F17 deep dive →
t = / (sd/√n)
  • 成对差的均值 mean of the within-pair differences
  • sd 成对差的样本标准差 sample standard deviation of the paired differences
何时用: Use it when: 同一对象前后测量,或观测值按设计一一匹配。 Measurements are before/after on the same unit or deliberately matched one to one.
T2-9

单比例 z 检验 One-Proportion z Test

F19 深潜 → F19 deep dive →
z = (p0) / √[p0(1 − p0)/n]
  • 样本比例 observed sample proportion
  • p0 原假设比例 proportion stated by the null hypothesis
何时用: Use it when: 样本量足够大,需要检验一个二项比例是否等于 p0 The sample is large enough for the normal approximation and one binomial proportion is tested against p0.
T2-10

卡方检验 Chi-Square Test

F19 深潜 → F19 deep dive →
χ2 = Σ(OE)2/E
Eij = RiCj/N  ;  df = (r−1)(c−1)
  • O / E 观察频数/期望频数 observed and expected cell counts
  • Ri / Cj / N 第 i 行合计/第 j 列合计/总数 row i total / column j total / grand total
  • r / c 列联表行数/列数 numbers of rows and columns in the contingency table
何时用: Use it when: 检验分类变量独立性,或观察频数是否偏离期望频数。 You need to test independence between categorical variables or observed counts against expected counts.
F = s1 2/s2 2  ;  df = (n1−1, n2−1)
  • s1 2 两者中较大的样本方差,放在分子 the larger sample variance, placed in the numerator
  • df 分子与分母各自的自由度 separate numerator and denominator degrees of freedom
何时用: Use it when: 正态前提成立,需要直接比较两个总体方差。 Normality is defensible and two population variances must be compared directly.
T3

进阶 · 设计检验与稳健替代Advanced · Design the Test and Choose Robust Alternatives

4 张进阶卡4 advanced cards
T3-12

样本量(均值)Sample Size for a Mean

F15 深潜 →F15 deep dive →
n = [(zα/2 + zβ)·σ / δ]2
  • δ要探测的最小差异smallest difference worth detecting
  • zβ目标功效对应的标准正态分位数standard normal quantile set by target power
何时用:Use it when: 采样前按 α、功效、σ 与最小有意义差异规划样本量。You are planning sample size from α, power, σ, and the minimum meaningful difference before data collection.
T3-13

样本量(比例)Sample Size for Two Proportions

F15 深潜 →F15 deep dive →
n = (zα/2 + zβ)2 · [p1(1−p1) + p2(1−p2)] / (p1 − p2)2
  • p1, p2计划比较的两个比例the two proportions the study is designed to compare
  • p1 − p2计划探测的比例差proportion difference the study must detect
何时用:Use it when: 采样前为两个比例之差规划每组样本量。You are planning per-group sample size for a difference between two proportions.
T3-14

效应量 Cohen's dCohen's d Effect Size

F15 深潜 →F15 deep dive →
d = (x̄1 − x̄2) / sp
0.2  /  0.5  /  0.8
  • d以合并标准差为单位的均值差mean difference expressed in pooled-standard-deviation units
  • sp两组的合并标准差pooled standard deviation of the two groups
  • 0.2 / 0.5 / 0.8小/中/大效应量参考值small / medium / large effect-size guideposts
何时用:Use it when: 显著性之外还要报告差异有多大,并跨量纲比较。You must report how large the difference is, not merely whether it is statistically significant.
T3-15

非参数替代表Nonparametric Alternatives

F21 深潜 →F21 deep dive →
t test ↔ Mann–Whitney U / Wilcoxon signed-rank
ANOVA ↔ Kruskal–Wallis
  • Mann–Whitney U两个独立样本的秩检验rank test for two independent samples
  • Wilcoxon配对数据的符号秩检验signed-rank test for paired data
  • Kruskal–Wallis多组独立样本的秩检验rank test for multiple independent groups
何时用:Use it when: 数据非正态或为有序数据,参数检验前提不成立。Data are non-normal or ordinal and the parametric assumptions are not credible.
相关教学页 Related teaching pages
33 · 假设检验框架33 · Hypothesis framework 34 · 功效与样本量34 · Power and sample size 36 · 单样本 t36 · One-sample t 37 · 两样本 t37 · Two-sample t 40 · 比例检验40 · Proportion test 41 · 方差检验41 · Variance test 42 · 非参数检验42 · Nonparametric tests
其他公式总表 Other formula sheets
FH01 流程能力FH01 Capability FH02 假设检验FH02 Hypothesis Testing FH03 方差分析FH03 ANOVA FH04 回归FH04 Regression FH05 DOE FH06 SPC FH07 MSA

假设检验公式总表