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