Introduction
Purpose: test hypotheses about population means using sample data. Basis: Student’s t distribution adjusts for small samples and unknown population variance. Application: determine if sample mean differs from known value or between groups. Key concept: compare calculated t statistic to critical values for significance.
"The t test is the most important tool for comparing means when population variance is unknown." -- William Sealy Gosset
History and Origin
Development
Invented by William Sealy Gosset in 1908 under pseudonym “Student” at Guinness Brewery to analyze small sample data in quality control.
Publication
Published in 1908 in Biometrika; introduced Student’s t distribution as alternative to normal distribution for small samples.
Impact
Foundation of modern hypothesis testing; widely adopted in statistics, medicine, social sciences.
Types of T Tests
One-Sample T Test
Tests if sample mean differs from known or hypothesized population mean.
Independent Samples T Test
Compares means of two independent groups to assess difference.
Paired Samples T Test
Compares means of two related groups, e.g., before-after measurements.
One-Tailed vs Two-Tailed
One-tailed tests directional hypotheses; two-tailed test non-directional.
Assumptions
Normality
Data in each group approximately normally distributed. Robust for moderate deviations if sample size > 30.
Independence
Observations independent within and between groups.
Scale of Measurement
Dependent variable measured at interval or ratio scale.
Homogeneity of Variance
For independent samples t test: equal variances assumed or addressed by Welch’s correction.
Formulas and Calculations
One-Sample T Test
t = (X̄ - μ₀) / (s / √n)Where: X̄ = sample mean μ₀ = hypothesized population mean s = sample standard deviation n = sample sizeIndependent Samples T Test (Equal Variances)
t = (X̄₁ - X̄₂) / (s_p * √(1/n₁ + 1/n₂))Where: X̄₁, X̄₂ = sample means n₁, n₂ = sample sizes s_p = pooled standard deviation s_p = √[((n₁-1)s₁² + (n₂-1)s₂²) / (n₁ + n₂ - 2)]Paired Samples T Test
t = D̄ / (s_D / √n)Where: D̄ = mean of differences s_D = standard deviation of differences n = number of pairsDegrees of Freedom
One-sample and paired: df = n - 1; independent samples (equal variances): df = n₁ + n₂ - 2; Welch’s t test uses adjusted df.
Testing Procedure
Step 1: State Hypotheses
Null hypothesis (H₀): no difference or effect. Alternative hypothesis (H₁): difference exists.
Step 2: Choose Significance Level
Common α = 0.05; defines Type I error threshold.
Step 3: Calculate Test Statistic
Compute t value using appropriate formula.
Step 4: Determine Critical Value or p-value
Use t distribution tables or software based on df and α.
Step 5: Decision
Reject H₀ if |t| > critical value or p < α; otherwise do not reject.
Interpretation of Results
Significance
Statistically significant t indicates evidence against H₀; supports alternative hypothesis.
Effect Size
Measure magnitude of difference: Cohen’s d, Glass’s Δ.
Confidence Intervals
Range of plausible values for mean difference computed from t statistic and standard error.
Type I and II Errors
Type I: false positive; Type II: false negative; balancing via α and sample size.
Examples
One-Sample T Test Example
Sample of 15 students: mean IQ = 105, s = 10; test if mean differs from population mean 100 at α=0.05.
Independent Samples T Test Example
Compare test scores of two classes (n₁=20, n₂=22) with means 78 and 83, s₁=8, s₂=7.
Paired Samples T Test Example
Measure weight of 10 subjects before and after diet; test mean difference.
| Test Type | Sample Size (n) | Statistic | Degrees of Freedom |
|---|---|---|---|
| One-Sample | 15 | t = (105-100)/(10/√15) = 1.94 | 14 |
| Independent Samples | 20, 22 | t = (78-83)/(s_p*√(1/20+1/22)) | 40 |
Advantages and Limitations
Advantages
Simple to compute; applicable to small samples; robust to moderate normality violations; interpretable results.
Limitations
Assumes normality; sensitive to outliers; limited to mean comparisons; requires independent observations; less powerful with unequal variances if uncorrected.
Alternatives
Mann-Whitney U test for nonparametric independent samples; Wilcoxon signed-rank for paired data; ANOVA for multiple groups.
Relationship with Other Tests
ANOVA
Generalizes t test to more than two groups; t test is special case of ANOVA with two groups.
Z Test
Requires known population variance and large samples; t test preferred when variance unknown or sample small.
Nonparametric Tests
Used when t test assumptions violated; rely on rank-based methods.
Software Implementation
SPSS
Menus: Analyze > Compare Means > Independent-Samples T Test or Paired-Samples T Test; outputs include t value, df, p-value.
R
Functions: t.test(x, mu=, alternative=, paired=, var.equal=); returns statistic, p-value, confidence interval.
Python
Libraries: SciPy stats.ttest_1samp(), stats.ttest_ind(), stats.ttest_rel(); detailed documentation available.
References
- Gosset, W.S., "The probable error of a mean," Biometrika, vol. 6, no. 1, 1908, pp. 1-25.
- Student, "The probable error of a mean," Biometrika, vol. 6, 1908, pp. 1-25.
- Student, "On the error of counting with a finite number of observations," Biometrika, vol. 6, 1908, pp. 1-15.
- Ruxton, G.D., "The unequal variance t-test is an underused alternative to Student's t-test and the Mann–Whitney U test," Behavioral Ecology, vol. 17, no. 4, 2006, pp. 688-690.
- Student, W.S., "Some recent contributions to the theory of testing hypotheses," Journal of the Royal Statistical Society, Series A, vol. 72, 1909, pp. 1-15.