独立双样本 t 检验计算器

Independent Two-Sample t-Test Calculator

📐 计算公式
独立样本 t 检验(合并方差):s_p² = [(n₁−1)s₁² + (n₂−1)s₂²] ÷ (n₁+n₂−2);t = (m₁−m₂) ÷ √(s_p²×(1÷n₁ + 1÷n₂));df = n₁+n₂−2;双侧 p 由不完全 Beta 函数 betai(df/2, 0.5, df ÷ (df+t²)) 精确求值。校验:6 项非空守卫,另提示卡要求 n≥2 且 s>0。判据(提示卡):两标准差之比 >2 建议 Welch 校正(附 Welch t 与 dfw)、n<15 提示样本偏小,并给效应量 Cohen d = (m₁−m₂) ÷ s_p。
独立双样本 t 统计量用两组均值之差除以合并标准误,衡量两组总体均值是否有显著差异。合并方差 s_p² 按两组样本量加权平均,自由度 df = n₁ + n₂ − 2。|t| 越大,越倾向拒绝「两组均值相等」的原假设。

Enter two independent samples (means, standard deviations and sizes) to compute the t value and p value and test whether the two population means differ significantly.

Formula & Standard References

Item Formula / Note Source / Standard
Pooled-variance t statistic t = (xbar1 - xbar2) / (s_p · sqrt(1/n1 + 1/n2)) Student (1908), The probable error of a mean, Biometrika 6(1)
Pooled variance s_p^2 = ((n1-1)s1^2 + (n2-1)s2^2) / (n1 + n2 - 2) NIST/SEMATECH e-Handbook of Statistical Methods §1.3.5.3
Welch correction t = (xbar1 - xbar2)/sqrt(s1^2/n1 + s2^2/n2), df by Welch-Satterthwaite Welch BL (1947), The generalization of Student's problem..., Biometrika 34
Assumptions Independent samples, near-normal populations, homogeneity of variance (Levene test) NIST/SEMATECH e-Handbook of Statistical Methods §1.3.5.3
📌 计算说明
  • 要求两组方差齐。
  • 方差不齐应 Welch 校正。

📚 深度解析:独立样本 t 检验

💡 常见使用场景

两组比较
m1=85、m2=80、sp=10、n1=n2=30:t=5/√(100×(2/30))=5/√6.667=5/2.582≈1.936,df=58。|t|>2.00 临界才显著(此处边缘)。
差异更大
m1−m2=10:t=10/2.582≈3.87,df=58 显著(p<0.001)。

❓ 常见问题(FAQ)

方差不齐怎么办?
用 Welch t 检验(df 经 Welch-Satterthwaite 校正),更稳健,多数软件默认。
t 与 z 检验区别?
σ 未知用小样本 t(用 s、t 分布);σ 已知或大样本用 z。