Learning Objectives
By the end of this chapter, you will be able to:
- Understand when to use t-tests instead of z-tests
- Perform one-sample t-tests for small samples
- Perform independent samples t-tests
- Calculate pooled variance and degrees of freedom
- Interpret t-test results correctly
When to Use t-Test
Use t-test when:
- Testing claims about population means
- Sample size is small (n < 30)
- Population is approximately normal
- σ is unknown (always for small samples)
flowchart TD
A[Testing mean?]
B{Is σ known?}
C{Is n ≥ 30?}
D[Z-test]
E{Is population<br/>normal?}
F[t-test]
G[Non-parametric test]
A --> B
B -->|Yes| D
B -->|No| C
C -->|Yes| D
C -->|No| E
E -->|Yes/Approx| F
E -->|No| G
The t-Distribution
Properties
- Bell-shaped, symmetric around 0
- Heavier tails than normal distribution
- Depends on degrees of freedom (df)
- As df → ∞, t → z (normal)
flowchart LR
A["df = 5: Heavy tails"]
B["df = 15: Moderate tails"]
C["df = 30: Near normal"]
D["df = ∞: Normal"]
A --> B --> C --> D
One-Sample t-Test
Test Statistic
\[t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}\]Degrees of freedom: df = n - 1
Step-by-Step Example 1: One-Sample t-Test
Problem: A government claims average processing time is 30 minutes. A sample of 16 cases shows:
- Mean: 34 minutes
- Standard deviation: 8 minutes
Test at α = 0.05 if processing time exceeds 30 minutes.
Solution:
Step 1: State hypotheses
- $H_0: \mu = 30$
- $H_1: \mu > 30$ (right-tailed)
Step 2: Check conditions
- n = 16 < 30 (small sample)
- σ unknown
- Assume population is approximately normal
Step 3: Calculate test statistic \(t = \frac{34 - 30}{8/\sqrt{16}} = \frac{4}{2} = 2.00\)
Step 4: Find critical value
- df = 16 - 1 = 15
- Right-tailed, α = 0.05
- From t-table: t* = 1.753
Step 5: Decision
- t = 2.00 > 1.753
- Reject H₀
Step 6: Conclusion At the 0.05 level of significance, there is sufficient evidence to conclude that average processing time exceeds 30 minutes.
t-Table Reference (Selected Values)
| df | α = 0.10 | α = 0.05 | α = 0.025 | α = 0.01 | α = 0.005 |
|---|---|---|---|---|---|
| 5 | 1.476 | 2.015 | 2.571 | 3.365 | 4.032 |
| 10 | 1.372 | 1.812 | 2.228 | 2.764 | 3.169 |
| 15 | 1.341 | 1.753 | 2.131 | 2.602 | 2.947 |
| 20 | 1.325 | 1.725 | 2.086 | 2.528 | 2.845 |
| 25 | 1.316 | 1.708 | 2.060 | 2.485 | 2.787 |
| 30 | 1.310 | 1.697 | 2.042 | 2.457 | 2.750 |
Note: For two-tailed test at α = 0.05, use α/2 = 0.025 column.
Independent Samples t-Test
Used to compare means from two independent groups when at least one sample is small.
Assumptions
- Both samples are random and independent
- Both populations are approximately normal
- Population variances are equal (for pooled t-test)
Pooled Variance
When we assume equal population variances:
\[s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1 + n_2 - 2}\]Pooled Standard Error
\[SE = s_p\sqrt{\frac{1}{n_1} + \frac{1}{n_2}}\]Test Statistic
\[t = \frac{\bar{x}_1 - \bar{x}_2}{s_p\sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}\]Degrees of freedom: df = n₁ + n₂ - 2
Step-by-Step Example 2: Independent Samples t-Test
Problem: Compare productivity of two teams:
| Team A | Team B | |
|---|---|---|
| n | 12 | 10 |
| Mean | 85 | 78 |
| SD | 8 | 10 |
Test at α = 0.05 if Team A has higher productivity.
Solution:
Step 1: State hypotheses
- $H_0: \mu_1 = \mu_2$
- $H_1: \mu_1 > \mu_2$ (right-tailed)
Step 2: Calculate pooled variance \(s_p^2 = \frac{(12-1)(8)^2 + (10-1)(10)^2}{12 + 10 - 2}\) \(= \frac{11(64) + 9(100)}{20} = \frac{704 + 900}{20} = \frac{1604}{20} = 80.2\)
\[s_p = \sqrt{80.2} = 8.96\]Step 3: Calculate standard error \(SE = 8.96\sqrt{\frac{1}{12} + \frac{1}{10}} = 8.96\sqrt{0.0833 + 0.1} = 8.96\sqrt{0.1833}\) \(= 8.96 \times 0.428 = 3.84\)
Step 4: Calculate test statistic \(t = \frac{85 - 78}{3.84} = \frac{7}{3.84} = 1.82\)
Step 5: Find critical value
- df = 12 + 10 - 2 = 20
- Right-tailed, α = 0.05
- t* = 1.725
Step 6: Decision
- t = 1.82 > 1.725
- Reject H₀
Step 7: Conclusion At the 0.05 level of significance, there is sufficient evidence to conclude that Team A has higher productivity than Team B.
Step-by-Step Example 3: Two-Tailed t-Test
Problem: Compare exam scores of two teaching methods:
| Method 1 | Method 2 | |
|---|---|---|
| n | 15 | 18 |
| Mean | 72 | 78 |
| SD | 10 | 12 |
Test at α = 0.05 if means differ.
Solution:
Step 1: State hypotheses
- $H_0: \mu_1 = \mu_2$
- $H_1: \mu_1 \neq \mu_2$ (two-tailed)
Step 2: Calculate pooled variance \(s_p^2 = \frac{(14)(100) + (17)(144)}{31} = \frac{1400 + 2448}{31} = \frac{3848}{31} = 124.13\)
\[s_p = 11.14\]Step 3: Calculate standard error \(SE = 11.14\sqrt{\frac{1}{15} + \frac{1}{18}} = 11.14\sqrt{0.0667 + 0.0556}\) \(= 11.14\sqrt{0.1222} = 11.14 \times 0.350 = 3.90\)
Step 4: Calculate test statistic \(t = \frac{72 - 78}{3.90} = \frac{-6}{3.90} = -1.54\)
Step 5: Find critical value
- df = 15 + 18 - 2 = 31
- Two-tailed, α = 0.05
- t* = ±2.040 (approximately, for df = 30)
Step 6: Decision
- |t| = 1.54 < 2.040
- Fail to Reject H₀
Step 7: Conclusion At the 0.05 level of significance, there is insufficient evidence to conclude that the teaching methods produce different mean scores.
Confidence Interval for Difference of Means
\[(\bar{x}_1 - \bar{x}_2) \pm t^* \times SE\]Example 4: 95% CI
Using Example 2 data:
- Difference = 85 - 78 = 7
- SE = 3.84
- df = 20, t* = 2.086 (two-tailed)
\(95\% \text{ CI} = 7 \pm 2.086 \times 3.84 = 7 \pm 8.01\) \(= (-1.01, 15.01)\)
Since 0 is in the interval, at 95% confidence the difference is not significant (for two-tailed test).
Unequal Variances (Welch’s t-Test)
When population variances are NOT equal, use Welch’s approximation:
Test Statistic
\[t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}\]Degrees of Freedom (Welch-Satterthwaite)
\[df = \frac{\left(\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}\right)^2}{\frac{(s_1^2/n_1)^2}{n_1-1} + \frac{(s_2^2/n_2)^2}{n_2-1}}\](This is complex - often calculated by software)
Summary: Choosing the Right Test
| Condition | Test to Use |
|---|---|
| σ known, any n | Z-test |
| σ unknown, n ≥ 30 | Z-test (with s) |
| σ unknown, n < 30, normal pop | t-test |
| Equal variances assumed | Pooled t-test |
| Unequal variances | Welch’s t-test |
Practice Problems
Problem 1
A sample of 20 employees has mean productivity 95 with s = 15. Test at α = 0.05 if mean differs from 100.
Problem 2
Compare two groups:
- Group 1: n = 10, $\bar{x}$ = 45, s = 6
- Group 2: n = 12, $\bar{x}$ = 40, s = 8
Test at α = 0.05 if means differ.
Problem 3
For Problem 2, construct a 95% CI for the difference in means.
Problem 4
Test scores:
- Morning class: n = 15, $\bar{x}$ = 82, s = 10
- Afternoon class: n = 18, $\bar{x}$ = 76, s = 12
Test if morning class has higher scores at α = 0.01.
Problem 5
A sample of 25 gives $\bar{x}$ = 50, s = 8. Find the 99% CI for the population mean.
Summary
| Component | Formula |
|---|---|
| One-sample t | $t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}$, df = n-1 |
| Pooled variance | $s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1 + n_2 - 2}$ |
| Two-sample t | $t = \frac{\bar{x}_1 - \bar{x}_2}{s_p\sqrt{1/n_1 + 1/n_2}}$, df = n₁+n₂-2 |
| Decision | Compare t to critical value from t-table |
Next Topic
In the next chapter, we will study Paired t-Test - testing for differences when samples are dependent (matched pairs).

