9.2 One-Sample and Two-Sample t-Tests for Means
Key Takeaways
- Student's t-tests are parametric inferential tests for continuous data when the population standard deviation σ is unknown and estimated by the sample standard deviation s, introducing heavier tails and degrees of freedom.
- The One-Sample t-test compares a single sample mean (x̄) against a known target or historical specification (μ0) with degrees of freedom df = n - 1.
- The Two-Sample Independent t-test compares the means of two mutually exclusive groups; an F-test or Levene's test must be conducted first to determine whether to use pooled variance (df = n1 + n2 - 2) or Welch's unpooled variance.
- Pooled variance combines the sample variances weighted by their degrees of freedom when population variances are equal, whereas Welch's test adjusts degrees of freedom downward to protect against unequal variances.
- If the 95% Confidence Interval for the difference between two means encompasses zero, fail to reject H0 (p > 0.05); if the entire interval excludes zero, reject H0 (p ≤ 0.05).
9.2 One-Sample and Two-Sample t-Tests for Means
Quick Summary: In the Analyze and Improve phases of DMAIC, continuous metrics—such as component dimensions, cycle times, pressure, fluid temperature, and chemical concentrations—must be statistically evaluated to validate root causes or verify that solutions shifted process averages. When the true population standard deviation $\sigma$ is unknown, practitioners utilize Student's $t$-tests. The One-Sample $t$-test compares a single sample mean ($\bar{x}$) to a hypothesized target or customer specification ($\mu_0$). The Two-Sample Independent $t$-test compares means from two mutually exclusive groups ($\mu_1$ vs. $\mu_2$), requiring an preliminary $F$-test to determine whether to pool variances or deploy Welch's unpooled formulation.
Foundations of Parametric Means Testing
A parametric test makes specific mathematical assumptions regarding the parameters of the underlying probability distribution from which sample data is drawn. The three core parametric assumptions for $t$-tests are:
- Continuous Metric Data: The dependent response variable ($Y$) is measured on a continuous interval or ratio scale (e.g., millimeters, seconds, degrees Celsius, foot-pounds).
- Random and Independent Sampling: Data observations are collected randomly, and the measurement of one unit does not influence or depend upon another.
- Normality: The data within each group is approximately normally distributed. By virtue of the Central Limit Theorem, $t$-tests are robust against moderate violations of normality when subgroup sample sizes satisfy $n \ge 30$.
When these assumptions hold, the $t$-test family provides the most statistically powerful framework available for evaluating continuous means.
Why Student's t Instead of Z?
When evaluating a sample mean, if the true population standard deviation $\sigma$ were known from exhaustive historical records, the test statistic would follow the Standard Normal $Z$-distribution:
However, in real-world industrial environments, the population standard deviation $\sigma$ is virtually never known. Practitioners must estimate $\sigma$ using the sample standard deviation ($s$):
Because $s$ varies from sample to sample, substituting $s$ for $\sigma$ introduces an additional source of random sampling error. In 1908, William Sealy Gosset (publishing under the pen name "Student" while working at the Guinness Brewery in Dublin) derived the Student's $t$-distribution to account for this extra variability.
Comparison of Z vs. Student's t-Distribution
┌───┐ ◀── Z Distribution (Taller peak, thin tails)
┌──┘ └──┐
┌─┘ ┌───┐ └─┐
┌─┘ ┌──┘ └──┐ └─┐ ◀── t Distribution (Lower peak, fat tails)
───┴───┴─────────┴───┴───
-3 -2 -1 0 1 2 3
- The $t$-distribution is symmetric and bell-shaped with a mean of 0, but features heavier (fatter) tails and a lower center peak than the standard normal curve.
- The heavier tails mean that extreme values occur more frequently, requiring larger critical values to achieve statistical significance at a given $\alpha$.
- Governed by degrees of freedom ($df$); as sample size increases ($df \to \infty$), the $t$-distribution converges toward the standard normal $Z$-distribution.
The One-Sample t-Test
Purpose & Operational Context
The One-Sample $t$-test evaluates whether the arithmetic mean of a single continuous sample ($\bar{x}$) is statistically significantly different from a known benchmark, engineering specification, historical standard, or contractual target ($\mu_0$), when $\sigma$ is unknown.
Test Statistic & Formula
Where:
- $\bar{x} = $ Sample mean
- $\mu_0 = $ Hypothesized population target
- $s = $ Sample standard deviation
- $n = $ Sample size
- $\text{Standard Error: } SE = \frac{s}{\sqrt{n}}$
- $\mathbf{Degrees\ of\ Freedom:}\ df = n - 1$
Step-by-Step Worked Example: One-Sample $t$-Test
Scenario: A precision CNC milling center produces stainless steel shafts with an engineering target diameter of $\mu_0 = 50.00\text{ mm}$. A quality engineer samples $n = 16$ consecutive shafts to verify machine calibration. The sample yields:
- Sample mean: $\bar{x} = 50.08\text{ mm}$
- Sample standard deviation: $s = 0.12\text{ mm}$
- Significance level: $\alpha = 0.05$ (two-tailed)
Step 1: State the Hypotheses
- $H_0: \mu = 50.00\text{ mm}$ (Machine is on target)
- $H_a: \mu \ne 50.00\text{ mm}$ (Machine has drifted off target)
Step 2: Determine Degrees of Freedom and Critical $t$-Value
- $df = n - 1 = 16 - 1 = 15$
- Looking up a two-tailed $t$-distribution table at $\alpha = 0.05$ ($0.025$ per tail) with $df = 15$:
Step 3: Calculate the Test Statistic ($t_{\text{calc}}$)
- Standard Error: $SE = \frac{s}{\sqrt{n}} = \frac{0.12}{\sqrt{16}} = \frac{0.12}{4} = 0.030\text{ mm}$
- $t_{\text{calc}} = \frac{50.08 - 50.00}{0.030} = \frac{+0.08}{0.030} = +2.667$
Step 4: Formulate the Decision and Confidence Interval
- Decision Rule: Reject $H_0$ if $|t_{\text{calc}}| \ge 2.131$.
- Since $|+2.667| > 2.131$ (corresponding to software $p = 0.0177 < 0.05$), we Reject $H_0$.
- 95% Confidence Interval for $\mu$:
- Notice that the 95% CI $[50.016, 50.144]$ excludes the target value of $50.00\text{ mm}$, confirming rejection of $H_0$.
- Conclusion: There is statistically significant evidence at $\alpha = 0.05$ that the CNC machine has drifted off target; the mean shaft diameter ($50.08\text{ mm}$) is significantly greater than $50.00\text{ mm}$.
The Two-Sample Independent t-Test
Purpose & Architecture
The Two-Sample Independent $t$-test compares the means of two mutually exclusive, unrelated groups to determine whether they originate from populations with identical means:
- Comparing yield strength between Supplier A and Supplier B.
- Comparing cycle time between Day Shift and Night Shift.
- Comparing wear rates between Machine 1 and Machine 2.
Two-Sample Independent t-Test Architecture
GROUP 1 (e.g., Supplier A) GROUP 2 (e.g., Supplier B)
Independent Random Sample Independent Random Sample
n1, x̄1, s1 n2, x̄2, s2
│ │
└─────────────────────┬──────────────────────┘
▼
Compare Means: μ1 vs. μ2
H0: μ1 - μ2 = 0 (Equal)
Ha: μ1 - μ2 ≠ 0 (Different)
Critical Pre-requisite: The F-Test for Equal Variances
Before running an independent two-sample $t$-test, the Green Belt must verify whether the two population variances are equal ($\sigma_1^2 = \sigma_2^2$). This is tested using an $F$-test of Variances (or Levene's test):
- If Variances are Equal ($p \ge 0.05$): Use the Pooled Two-Sample $t$-test.
- If Variances are Unequal ($p < 0.05$): Use Welch's Unpooled $t$-test.
Case A: Pooled Two-Sample $t$-Test (Equal Variances Assumed)
When variances are homogeneous, the two sample variances are weighted and combined into a single pooled variance estimate ($s_p^2$):
Exam Trap: Notice why $df = n_1 + n_2 - 2$. Two degrees of freedom are lost because two independent sample statistics ($\bar{x}_1$ and $\bar{x}_2$) are estimated from the data.
Case B: Welch's Unpooled $t$-Test (Unequal Variances)
When variances are unequal, pooling is mathematically invalid. Welch's test uses individual sample standard deviations:
Degrees of freedom are calculated using the Welch-Satterthwaite approximation:
This formula adjusts $df$ downward into a non-integer value to compensate for variance disparity, protecting against inflated Type I error.
Step-by-Step Worked Example: Pooled Two-Sample $t$-Test
Scenario: A Green Belt investigates whether a new quenching oil formulation improves the hardness of carbon steel gears. Two independent production batches are quenched using Oil A (standard) and Oil B (new formulation). Hardness is measured in Rockwell C (HRC):
| Group | Sample Size ($n$) | Sample Mean ($\bar{x}$) | Sample Std Dev ($s$) |
|---|---|---|---|
| Oil A (Standard) | $n_1 = 12$ | $\bar{x}_1 = 58.2\text{ HRC}$ | $s_1 = 1.4\text{ HRC}$ |
| Oil B (New) | $n_2 = 14$ | $\bar{x}_2 = 60.1\text{ HRC}$ | $s_2 = 1.6\text{ HRC}$ |
Test whether the new quenching oil significantly increases gear hardness at $\alpha = 0.05$.
Step 1: Formulate Hypotheses
- $H_0: \mu_2 - \mu_1 \le 0$ (Oil B does not increase hardness)
- $H_a: \mu_2 - \mu_1 > 0$ (Oil B significantly increases hardness; one-tailed upper test)
Step 2: Verify Equality of Variances
- $F_{\text{calc}} = \frac{s_2^2}{s_1^2} = \frac{(1.6)^2}{(1.4)^2} = \frac{2.56}{1.96} = 1.306$
- Degrees of freedom: $df_1 = 14 - 1 = 13$, $df_2 = 12 - 1 = 11$.
- Critical $F_{0.05, 13, 11} = 2.79$. Since $1.306 < 2.79$ ($p > 0.10$), variances are homogeneous. Proceed with pooled $t$-test.
Step 3: Compute Pooled Variance ($s_p^2$) and Standard Error
Step 4: Calculate Test Statistic ($t_{\text{calc}}$)
Step 5: Make Statistical Decision
- Degrees of freedom: $df = n_1 + n_2 - 2 = 12 + 14 - 2 = 24$
- Critical value for one-tailed test at $\alpha = 0.05$ with $df = 24$: $t_{\text{crit}} = +1.711$
- Since $t_{\text{calc}} = +3.195 > +1.711$ ($p = 0.0019 < 0.05$), Reject $H_0$.
- Conclusion: Quenching Oil B delivers a statistically significant increase in gear hardness of approximately $1.90\text{ HRC}$ ($p = 0.0019$).
Interpreting Statistical Output & Confidence Intervals for Differences
Statistical packages output both test statistics ($t$, $p$) and an associated Confidence Interval for the Difference:
Interpreting the Confidence Interval for (μ1 - μ2)
INTERVAL CONTAINS ZERO: [-2.5, +1.8] INTERVAL EXCLUDES ZERO: [+1.4, +5.2]
-2.5 0 +1.8 0 +1.4 +5.2
├───┼──────┼────────┼──┤ ├───┼──────┼───────┼──┤
▲ ▲ ▲ ▲ ▲ ▲
LCL Zero UCL Zero LCL UCL
───────────────────────────────────── ─────────────────────────────────────
FAIL TO REJECT H0 (p > 0.05) REJECT H0 (p ≤ 0.05)
Difference may be zero (No effect) Statistically significant difference!
- If the 95% CI contains 0 (e.g., $[-1.40, +2.80]$): Zero is a plausible value for the true difference. Therefore, $p > 0.05$; Fail to Reject $H_0$.
- If the 95% CI excludes 0 (e.g., $[+1.20, +4.50]$ or $[-6.10, -1.80]$): Zero is ruled out as a plausible value. Therefore, $p \le 0.05$; Reject $H_0$.
Summary Selection Matrix for Continuous Means
| Test Name | Subgroups | Data Relationship | Population $\sigma$ Status | Degrees of Freedom ($df$) | Common Six Sigma Use Case |
|---|---|---|---|---|---|
| One-Sample $Z$-test | 1 sample | Single sample vs specification | Known (Rare) | $\infty$ ($Z$-table) | Baseline standard deviation known from long history. |
| One-Sample $t$-test | 1 sample | Single sample vs specification | Unknown (Estimated by $s$) | $df = n - 1$ | Verifying if current production meets specification target. |
| Two-Sample Pooled $t$-test | 2 samples | Independent / Unrelated | Unknown (Equal variances, $p \ge 0.05$) | $df = n_1 + n_2 - 2$ | Comparing mean cycle times of Line 1 vs Line 2. |
| Welch's Two-Sample $t$-test | 2 samples | Independent / Unrelated | Unknown (Unequal variances, $p < 0.05$) | Welch-Satterthwaite approx | Comparing suppliers with vastly different process variability. |
Critical CSSC Exam Traps
- Trap 1: Skipping the Equal Variance Check — Running a pooled two-sample $t$-test without verifying variance equality via an $F$-test risks invalid conclusions if variances differ significantly.
- Trap 2: Degrees of Freedom Confusion — For a pooled two-sample $t$-test, degrees of freedom is $df = n_1 + n_2 - 2$, NOT $n_1 + n_2 - 1$.
- Trap 3: One-Sided vs. Two-Sided Output — Most statistical software packages report two-tailed $p$-values by default. If your hypothesis is directional (one-tailed) and the sample shifted in the hypothesized direction, the one-tailed $p$-value is $p_{\text{two-tailed}} / 2$.
- Trap 4: Misinterpreting Difference CIs — If a 95% CI for $(\mu_1 - \mu_2)$ is $[-0.4, +3.2]$, the test cannot reject $H_0$ at $\alpha = 0.05$ because zero is contained in the interval.
A Six Sigma project team compares customer call handle times between a domestic service center (n1 = 24, s1 = 1.8 min) and an offshore service center (n2 = 30, s2 = 1.9 min). An F-test confirms that the population variances are equal (p = 0.74). The team executes a pooled Two-Sample t-test. How many degrees of freedom (df) are associated with this test?
A continuous improvement team evaluates a new drying oven configuration intended to reduce cycle time. The statistical software output for a Two-Sample t-test comparing the new oven to the baseline oven reports: Difference = μ_New - μ_Old; Estimate for difference: -3.40 minutes; 95% Confidence Interval for difference: [-5.10, -1.70] minutes; t-value = -3.95; p-value = 0.0004. At α = 0.05, what is the correct statistical conclusion?
A quality engineer evaluates two automated chemical filling nozzles. Nozzle 1 has a sample variance of s1² = 4.8 mL² with n1 = 15, while Nozzle 2 has a sample variance of s2² = 18.2 mL² with n2 = 15. A preliminary F-test for equal variances yields p = 0.008. If the engineer wishes to test whether the two nozzles deliver different mean fill volumes, which testing protocol must be used?