T-Test Calculator
Calculate one-sample, two-sample, and paired t-tests with p-values and confidence intervals
What is a T-Test?
A t-test is a statistical test used to determine if there is a significant difference between the means of two groups or between a sample mean and a known population mean. It is commonly used in hypothesis testing when the sample size is small and the population standard deviation is unknown.
Types of T-Tests
One-Sample T-Test:
Compares a sample mean to a known population mean
t = (x̄ - μ₀) / (s/√n)
Two-Sample T-Test:
Compares means of two independent groups
t = (x̄₁ - x̄₂) / √(s₁²/n₁ + s₂²/n₂)
Paired T-Test:
Compares means of related groups (before/after)
t = d̄ / (s_d/√n)
T-Test Formula
The general formula for t-statistic is:
t = (difference) / (standard error)
Degrees of Freedom
- One-sample: df = n - 1
- Two-sample (equal variance): df = n₁ + n₂ - 2
- Two-sample (unequal variance): df = (s₁²/n₁ + s₂²/n₂)² / ((s₁²/n₁)²/(n₁-1) + (s₂²/n₂)²/(n₂-1))
- Paired: df = n - 1
How to Use the Calculator
- Choose the type of t-test you want to perform
- Enter your data (sample means, standard deviations, sample sizes)
- Set your significance level (α)
- Click "Calculate" to get the t-statistic and p-value
- Interpret the results
Interpreting Results
- p-value < α: Reject the null hypothesis (significant difference)
- p-value ≥ α: Fail to reject the null hypothesis (no significant difference)
- |t| > critical value: Reject the null hypothesis
- |t| ≤ critical value: Fail to reject the null hypothesis
Example Calculations
One-Sample T-Test:
Sample mean = 52
Population mean = 50
Sample SD = 5
Sample size = 25
t = (52 - 50) / (5/√25) = 2
Two-Sample T-Test:
Group 1 mean = 75, SD = 10, n = 30
Group 2 mean = 70, SD = 12, n = 30
t = (75 - 70) / √(10²/30 + 12²/30) = 1.67
Assumptions for T-Tests
- Data should be normally distributed (approximately)
- Observations should be independent
- For two-sample tests, populations should have equal variances (unless using Welch's t-test)
- Data should be continuous