T-Test Calculator
Statistical T-Test Analysis
Perform one-sample, two-sample, and paired t-tests. Calculate t-statistic, p-value, confidence intervals, and test statistical significance.
T-Test Results
Confidence Interval:
Data Summary:
Test Conclusion:
Based on p-value and significance level...
Effect Size:
Cohen's d = 0.00 (Small effect)
Power Analysis:
Statistical power = 0.00%
Assumptions Check:
Normality, independence, equal variance
Step-by-Step Calculation:
T-Distribution Visualization:
T-distribution with degrees of freedom = df. Critical region shaded for α=0.05.
The t-test determines if there's a significant difference between means. Results are interpreted based on p-value and significance level.
What is a T-Test?
A t-test is a statistical hypothesis test used to determine if there is a significant difference between the means of two groups or between a sample mean and a population mean. It's used when the population standard deviation is unknown and the sample size is relatively small (typically n < 30).
Types of T-Tests
One-Sample T-Test
Compares sample mean to known population mean
Example: Test if average height differs from national average
Two-Sample T-Test
Compares means of two independent groups
Example: Test if drug A differs from drug B
Paired T-Test
Compares paired measurements (before/after)
Example: Test if training improves performance
Welch's T-Test
Used when group variances are unequal
More conservative than standard t-test
When to Use Each T-Test
1. One-Sample T-Test
- Purpose: Test if sample mean differs from known population mean
- Example: Is average student test score different from national average?
- Assumptions: Normally distributed data, independent observations
- Formula: t = (x̄ - μ₀) / (s/√n)
2. Two-Sample T-Test
- Purpose: Compare means of two independent groups
- Example: Do men and women have different average salaries?
- Assumptions: Normality, independence, equal variances (unless using Welch's)
- Formula: t = (x̄₁ - x̄₂) / √(s²₁/n₁ + s²₂/n₂)
3. Paired T-Test
- Purpose: Compare measurements from same subjects at two times
- Example: Does blood pressure decrease after medication?
- Assumptions: Paired differences are normally distributed
- Formula: t = d̄ / (sd/√n) where d = xafter - xbefore
T-Test Decision Rules
| P-value Range | Significance Level (α) | Decision | Interpretation |
|---|---|---|---|
| p ≤ 0.01 | α = 0.01 | Reject H₀ | Highly statistically significant |
| 0.01 < p ≤ 0.05 | α = 0.05 | Reject H₀ | Statistically significant |
| 0.05 < p ≤ 0.10 | α = 0.10 | Reject H₀* | Marginally significant (*context dependent) |
| p > 0.10 | Any α | Fail to reject H₀ | Not statistically significant |
Real-World Applications
Medical Research
- Clinical trials: Test drug effectiveness vs placebo
- Treatment comparisons: Compare different treatment protocols
- Diagnostic tests: Evaluate new diagnostic methods
- Epidemiology: Study disease prevalence in different groups
Business & Economics
- Marketing research: Compare campaign effectiveness
- Quality control: Test if production meets specifications
- Salary analysis: Compare wages across departments
- Customer satisfaction: Test service improvements
Education & Psychology
- Teaching methods: Compare different instructional approaches
- Psychological tests: Assess treatment effectiveness
- Learning assessment: Test knowledge gains after training
- Survey analysis: Compare attitudes between groups
Science & Engineering
- Experiment analysis: Compare control vs experimental groups
- Manufacturing: Test material strength differences
- Environmental science: Compare pollution levels
- Agriculture: Test fertilizer effectiveness
Step-by-Step T-Test Procedure
Example: One-Sample T-Test
- State hypotheses: H₀: μ = 70, H₁: μ ≠ 70 (two-tailed)
- Collect data: Sample: [65, 68, 72, 70, 67, 71, 69]
- Calculate sample statistics: n=7, x̄=68.86, s=2.41
- Compute t-statistic: t = (68.86 - 70) / (2.41/√7) = -1.14/0.91 = -1.25
- Determine degrees of freedom: df = n - 1 = 6
- Find p-value: For t=-1.25, df=6, two-tailed p = 0.256
- Make decision: Since p=0.256 > α=0.05, fail to reject H₀
- Conclusion: No significant evidence that mean differs from 70
Example: Two-Sample T-Test
- State hypotheses: H₀: μ₁ = μ₂, H₁: μ₁ ≠ μ₂
- Collect data: Group 1: [25,28,30,27,26], Group 2: [22,24,23,25,21]
- Calculate group statistics: x̄₁=27.2, s₁=1.92, x̄₂=23.0, s₂=1.58
- Compute pooled variance: s²p = [(4×1.92²)+(4×1.58²)]/(5+5-2) = 3.08
- Calculate t-statistic: t = (27.2-23.0)/√(3.08×(1/5+1/5)) = 4.2/1.11 = 3.78
- Degrees of freedom: df = n₁ + n₂ - 2 = 8
- Find p-value: For t=3.78, df=8, two-tailed p = 0.005
- Conclusion: Significant difference between group means (p=0.005)
Common T-Test Mistakes to Avoid
| Mistake | Problem | Solution |
|---|---|---|
| Using t-test for non-normal data | Violates normality assumption | Use non-parametric tests (Mann-Whitney, Wilcoxon) |
| Ignoring equal variance assumption | Can lead to incorrect p-values | Use Welch's t-test when variances unequal |
| Multiple testing without adjustment | Increases Type I error rate | Use Bonferroni or other corrections |
| Confusing statistical and practical significance | Small p-value doesn't mean large effect | Report effect size (Cohen's d) |
| Small sample size | Low statistical power | Ensure adequate sample size (power analysis) |
Related Calculators
Frequently Asked Questions (FAQs)
Q: What's the difference between t-test and z-test?
A: Use t-test when population standard deviation is unknown (estimated from sample) and sample size is small. Use z-test when population standard deviation is known or sample size is large (n > 30).
Q: What does "degrees of freedom" mean in t-test?
A: Degrees of freedom (df) represent the number of independent pieces of information available to estimate variability. For one-sample t-test: df = n-1. For two-sample: df = n₁ + n₂ - 2 (pooled) or calculated differently for Welch's test.
Q: How do I interpret p-value?
A: p-value is the probability of obtaining results as extreme as observed, assuming null hypothesis is true. Small p-value (typically < 0.05) suggests evidence against null hypothesis. p > 0.05 means insufficient evidence to reject null hypothesis.
Q: What is effect size and why is it important?
A: Effect size (e.g., Cohen's d) measures the magnitude of difference, independent of sample size. While p-value tells you if there's a difference, effect size tells you how large the difference is. Cohen's d: 0.2=small, 0.5=medium, 0.8=large effect.
Q: When should I use one-tailed vs two-tailed test?
A: Use two-tailed test when you're testing for any difference (direction unknown). Use one-tailed test when you have specific directional hypothesis (e.g., treatment increases scores). One-tailed tests have more power but require stronger theoretical justification.
Perform statistical hypothesis tests with Toolivaa's free T-Test Calculator, and explore more statistical tools in our Math Calculators collection.