T-Statistic Calculator

T-Statistic Calculator

Compute the t-statistic, degrees of freedom, p-values, and critical t for one-sample and two-sample tests (Welch or pooled), and from correlation r.

Enter your values

Results

t-statistic
Degrees of freedom (df)
Critical t
p (two-tailed)
p (left)
p (right)
Decision at α

Two-tailed comparison unless you chose left/right tail.

Understanding the T-Statistic (Simple Guide)

The t-statistic measures how far your sample result is from what you’d expect under a null hypothesis, in units of standard error. It helps you decide whether a difference is likely due to random chance.

Common t-tests

  • One-sample: Compare a sample mean (x̄) to a known value (μ₀).
  • Two-sample (Welch): Compare means of two groups with possibly unequal variances and sizes.
  • Two-sample (pooled): Compare means assuming equal variances.
  • From r: Test if a correlation is different from 0.

Formulas

  • One-sample: t = (x̄ − μ₀) / (s / √n), df = n − 1
  • Welch two-sample: t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂), df ≈ [(s₁²/n₁ + s₂²/n₂)²] / [(s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)]
  • Pooled two-sample: sp² = ((n₁−1)s₁² + (n₂−1)s₂²)/(n₁+n₂−2), t = (x̄₁ − x̄₂) / √(sp²(1/n₁ + 1/n₂)), df = n₁ + n₂ − 2
  • From r: t = r √((n−2)/(1−r²)), df = n − 2

Tails and decisions

Two-tailed tests check for any difference; one-tailed tests check direction (less or greater). If |t| ≥ tcrit (or p ≤ α), you reject H₀.

Assumptions (quick check)

  • Independence of observations
  • Approximately normal data (small n); CLT helps for larger n
  • For pooled test: equal variances across groups

Example (one-sample)

x̄ = 12.5, μ₀ = 10, s = 3.2, n = 25 ⇒ t = (12.5−10)/(3.2/√25) = 3.91, df = 24. With α = .05 (two-tailed), tcrit ≈ 2.064. Since 3.91 > 2.064, reject H₀.

Leave a Comment