Chapter 2

Hypothesis Testing with T-Tests

📖 ~50 min read 📈 1 interactive chart ✍️ 1 practice question 🎯 2 linked games

2.1 When to Use the T-Test

In the previous chapter, we used the Z-test when the population standard deviation σ was known. In practice, this is rare. Most of the time, we estimate σ using the sample standard deviation s. When we make this substitution, the test statistic no longer follows a standard normal distribution — it follows a Student’s t-distribution.

The t-distribution was discovered by William Sealy Gosset, who published under the pseudonym “Student” while working at the Guinness brewery. It is similar to the normal distribution but has heavier tails, reflecting the additional uncertainty that comes from estimating σ with s.

Key Properties of the T-Distribution

  • Symmetric and bell-shaped, centered at zero
  • Heavier tails than the standard normal — extreme values are more likely
  • Shape depends on degrees of freedom (df): df = n − 1 for a one-sample t-test
  • As df increases, the t-distribution converges to the standard normal (Z) distribution
  • At df ≥ 30, the t and Z distributions are nearly indistinguishable
🏭 GreatLakes Manufacturing

GreatLakes has a new production line that has only produced 15 shafts so far. The population standard deviation is unknown — they only have the sample standard deviation s = 0.18 mm. Because σ is unknown and n is small, a t-test is the appropriate choice.

T-Distribution vs Standard Normal for Different Degrees of Freedom
One-Sample T-Test Statistic
📊 Excel: =(xbar-mu0)/(s/SQRT(n))
where x is the sample mean, μ0 is the hypothesized population mean, s is the sample standard deviation, n is the sample size, and df = n − 1.

You can also use Excel’s =T.TEST() function for comparing arrays, or compute the t-statistic manually with =(xbar-mu0)/(s/SQRT(n)).

🎮
Practice: T or Z Showdown Given a scenario, decide whether to use a Z-test or a t-test

2.2 One-Sample T-Test

The one-sample t-test follows the same logical framework as the Z-test: formulate hypotheses, compute a test statistic, compare it to a critical value (or compute a p-value), and make a decision. The only difference is that we use the t-distribution instead of the Z-distribution, and critical values come from t-tables with the appropriate degrees of freedom.

✎ Worked Example: One-Sample T-Test
1
Setup: GreatLakes samples n = 15 shafts from the new line. The sample mean is x = 10.06 mm and s = 0.18 mm. Test at α = 0.05 (two-tailed).
H0: μ = 10.00   Ha: μ ≠ 10.00
2
Compute the standard error:
SE = s / n1/2 = 0.18 / 151/2 = 0.18 / 3.873 = 0.04648
3
Compute the t statistic:
t = (10.06 − 10.00) / 0.04648 = 0.06 / 0.04648 = 1.291
4
Find the critical value. With df = 14 and α = 0.05 (two-tailed), the critical t = ±2.145.
|t| = 1.291 < 2.145 ⇒ Fail to reject H0
5
Result: At the 5% significance level, there is insufficient evidence that the mean diameter from the new line differs from 10.00 mm. The new line appears to be on target.
✓ Check Your Understanding
With df = 14 and α = 0.05 (two-tailed), the critical t value is:
1.96
2.145
2.624
1.761
🎮
Practice: Critical Value Estimator Build intuition for t critical values at different df and α levels

2.3 T-Test Assumptions and Robustness

The one-sample t-test relies on several assumptions:

  • Random sampling: The data must be collected through a random or representative sampling process.
  • Independence: Each observation must be independent of the others.
  • Approximate normality: The population from which the sample is drawn should be approximately normally distributed. This assumption is most important when n is small (n < 30).

Robustness

The t-test is robust to moderate departures from normality, especially when n is large. With n ≥ 30, the Central Limit Theorem ensures that the sampling distribution of x is approximately normal regardless of the population distribution. For small samples, check for severe skewness or outliers before relying on t-test results.

In GreatLakes’ case, with n = 15, the engineer should verify that the shaft diameter data does not show extreme skewness or outliers before trusting the t-test conclusion. A simple histogram or normal probability plot can help with this assessment.

💡 Key Takeaway

The t-test is the workhorse of hypothesis testing in practice because population standard deviations are rarely known. As the sample size grows, the t-distribution approaches the normal distribution, and the choice between t-test and Z-test matters less. For small samples, always check normality assumptions and watch for outliers.

🎮
Practice: Small Sample Trap Spot scenarios where small-sample assumptions are violated

Chapter Summary

In this chapter, we extended hypothesis testing to the more common scenario where the population standard deviation is unknown. Here is what you should take away:

💡 Chapter 2 Summary

When to Use the T-Test: Use a t-test instead of a Z-test when σ is unknown and must be estimated by the sample standard deviation s. The t-distribution has heavier tails, reflecting additional estimation uncertainty.

Degrees of Freedom: For a one-sample t-test, df = n − 1. As df increases, the t-distribution converges to the standard normal.

Same Logic, Different Distribution: The hypothesis testing procedure is identical to the Z-test; only the reference distribution and critical values change.

Assumptions: Random sampling, independence, and approximate normality. The t-test is robust to non-normality for larger samples.

📋 Chapter 2 — Formula Reference
Measure Formula Excel Function
T-Test Statistic
=(xbar-mu0)/(s/SQRT(n))
Degrees of Freedom
=COUNT(range)-1
Standard Error
=STDEV.S(range)/SQRT(COUNT(range))
Critical t
=T.INV.2T(alpha, df)
P-Value (two-tailed)
=T.DIST.2T(ABS(t), df)
📄
Download the GreatLakes T-Test Dataset
Coming Soon — Excel file with sample shaft measurements for practice
Up Next
Chapter 3: Two-Sample T-Tests