Independent Two-Sample t-Test Calculator

📐 计算公式
独立样本 t 检验(合并方差):s_p² = [(n₁−1)s₁² + (n₂−1)s₂²] ÷ (n₁+n₂−2);t = (m₁−m₂) ÷ SE;等方差合并时 SE=√(s_p²×(1÷n₁+1÷n₂))、df=n₁+n₂−2;Welch 时 SE=√(s₁²/n₁+s₂²/n₂)、df=(A+B)²/(A²/(n₁−1)+B²/(n₂−1))(A=s₁²/n₁、B=s₂²/n₂)。双侧 p 由不完全 Beta 函数 betai(df/2,0.5,df÷(df+t²)) 精确求值。校验:6 项非空守卫;主算强制 n₁、n₂ 为 ≥2 的整数且 s₁、s₂≥0(仅允许一组为 0;两组全为 0 时停答),不满足时停算并清空图表/明细/差异/历史;数据表的 t 统计量与自由度跟主算同源(均为合并方差口径),不再用 Welch 分母。判据(提示卡):两标准差之比 >2 建议 Welch 校正(附 Welch t 与 dfw)、n<15 提示样本偏小,并给效应量 Cohen d = (m₁−m₂) ÷ s_p。
独立双样本 t 统计量用两组均值之差除以合并标准误,衡量两组总体均值是否有显著差异。可选择等方差合并 t(s_p² 按样本量加权,df=n₁+n₂−2)或 Welch t(SE=√(s₁²/n₁+s₂²/n₂),df 用 Welch–Satterthwaite 近似);两者都输出 t、双侧 p 与均值差置信区间。

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 校正。