Overview
The t-test is used to test hypotheses about population means when the population standard deviation is unknown and must be estimated from sample data.
Types of T-Tests
| Type | Purpose |
|---|
| One-sample | Compare sample mean to hypothesized value |
| Independent two-sample | Compare means of two independent groups |
| Paired (dependent) | Compare means of matched pairs or before/after |
One-Sample T-Test
Test Statistic
t=s/nxˉ−μ0
Degrees of Freedom
df=n−1
Independent Two-Sample T-Test
Equal Variances Assumed (Pooled)
t=sp2(n11+n21)xˉ1−xˉ2
Pooled variance:
sp2=n1+n2−2(n1−1)s12+(n2−1)s22
Degrees of freedom:
df=n1+n2−2
Unequal Variances (Welch's T-Test)
t=n1s12+n2s22xˉ1−xˉ2
Degrees of freedom (Welch-Satterthwaite):
df=n1−1(s12/n1)2+n2−1(s22/n2)2(n1s12+n2s22)2
Paired T-Test
For differences d=x1−x2:
t=sd/ndˉ
Where:
- dˉ = mean of differences
- sd = standard deviation of differences
- df=n−1
Assumptions
- Random sampling
- Independence (except for paired data)
- Normal population OR n≥30
- For two-sample: homogeneity of variance (if using pooled)
Examples
Example 1: One-Sample T-Test
Test if mean differs from 75. Sample: n=16, xˉ=78, s=8. α=0.05.
H0:μ=75,H1:μ=75
t=8/1678−75=23=1.5
df=15,tcrit=2.131
∣1.5∣<2.131⇒Fail to reject H0
Example 2: Independent Two-Sample (Pooled)
Group A: n=12, xˉ=85, s=6
Group B: n=15, xˉ=80, s=8
Test H0:μ1=μ2 at α=0.05.
sp2=25(11)(36)+(14)(64)=25396+896=51.68
t=51.68(121+151)85−80=51.68(0.150)5=2.785=1.80
df=25,tcrit=2.060
∣1.80∣<2.060⇒Fail to reject H0
Example 3: Paired T-Test
Before/after measurements for 10 subjects:
| Subject | Before | After | Difference (d) |
|---|
| Mean | - | - | dˉ=4.5 |
| SD | - | - | sd=3.2 |
Test H0:μd=0 at α=0.05.
t=3.2/104.5=1.014.5=4.45
df=9,tcrit=2.262
∣4.45∣>2.262⇒Reject H0
Significant change from before to after.
Effect Size (Cohen's d)
d=spxˉ1−xˉ2
| d | Interpretation |
|---|
| 0.2 | Small |
| 0.5 | Medium |
| 0.8 | Large |
Confidence Interval
For difference in means:
(xˉ1−xˉ2)±tα/2,df×SE