COLLEGE STATISTICS • HYPOTHESIS TESTING

t-Test for a Mean — Hypothesis Test for a Mean (t-test)

How to test claims about a population mean when the population standard deviation is unknown.

Historical Context & Motivation

Statistical inference took a decisive turn in the early twentieth century when researchers confronted a practical problem: how do you draw reliable conclusions about a population mean when your sample is small and the population variance is unknown? Classical methods rooted in the normal distribution required knowledge of the population standard deviation σ, a quantity rarely available in practice. The resolution of this problem produced one of the most widely used statistical procedures in science—the one-sample t-test—and reshaped the way experimentalists analyze data across biology, psychology, engineering, and economics.

1908
Student's t-Distribution
William Sealy Gosset, a chemist at Guinness Brewery in Dublin, published a landmark paper under the pseudonym "Student" in Biometrika. He derived the sampling distribution of the ratio (x̄ − μ) / (s / √n), showing it differs substantially from the standard normal when n is small.
1925
Fisher's Formal Framework
R. A. Fisher rigorously proved Gosset's result, coined the term degrees of freedom, and published comprehensive t-distribution tables in Statistical Methods for Research Workers, making the t-test accessible to experimentalists worldwide.
1933
Neyman–Pearson Hypothesis Testing
Jerzy Neyman and Egon Pearson formalized the decision-theoretic framework of null and alternative hypotheses, Type I and Type II errors, and power—concepts that provide the logical scaffolding for the modern t-test.
1970s–Present
Software & Modern Practice
With the advent of statistical computing software (SAS, SPSS, R, Python), the t-test became a routine one-command procedure. Contemporary practice supplements the test with effect sizes, confidence intervals, and checks on assumptions via diagnostic plots.

The central question the one-sample t-test answers is deceptively simple: given a sample of n observations from a population with unknown σ, is there sufficient evidence to conclude that the true population mean μ differs from a hypothesized value μ₀? By replacing σ with the sample standard deviation s and accounting for the extra uncertainty this substitution introduces, the t-test extends the logic of z-tests to the situations researchers actually face—small to moderate samples with estimated variability.

Core Principles & Definitions

Before computing a single test statistic, it is essential to understand the conceptual architecture that supports the one-sample t-test. Several foundational ideas work in concert: the formulation of competing hypotheses, the selection of a significance level, the construction of a test statistic whose distribution is known under H₀, and a decision rule that controls the probability of a false alarm. The following grid distills these ideas.

1

Null & Alternative Hypotheses

The null hypothesis H₀ asserts that the population mean equals a specified value μ₀. The alternative hypothesis Hₐ specifies the direction of departure: two-tailed (μ ≠ μ₀), left-tailed (μ < μ₀), or right-tailed (μ > μ₀).
2

The t-Statistic

The test statistic t = (x̄ − μ₀) / (s / √n) measures how many estimated standard errors the sample mean lies from the hypothesized value. Under H₀, this ratio follows Student's t-distribution with n − 1 degrees of freedom.
3

Degrees of Freedom

With n observations used to compute s, one degree of freedom is consumed by x̄, leaving df = n − 1. Fewer degrees of freedom produce heavier tails, reflecting greater uncertainty in estimating σ.
4

Significance Level (α)

The significance level α (commonly 0.05) is the maximum tolerable probability of committing a Type I error—rejecting H₀ when it is actually true. The critical value(s) and rejection region are determined by α and the direction of Hₐ.
5

p-Value Decision Rule

The p-value is the probability, under H₀, of obtaining a test statistic at least as extreme as the one observed. If p ≤ α, the data are statistically significant and we reject H₀; otherwise, we fail to reject.
KEY TAKEAWAY
Think of the t-test as a courtroom trial. The null hypothesis is the presumption of innocence—the population mean equals μ₀ unless the evidence says otherwise. The t-statistic is the strength of the prosecution's case, measured in units of uncertainty (standard errors). The significance level α sets the burden of proof: how compelling must the evidence be before the jury (the analyst) delivers a guilty verdict (rejects H₀)? A small p-value means the evidence is strong enough to overcome the presumption.

Visual Explanation — The t-Distribution & Rejection Regions

The bell-shaped curve represents Student's t-distribution with df = 14. The two shaded red rejection regions in the tails each contain α/2 = 0.025 of the probability. If the computed t-statistic falls beyond the critical values ±t* ≈ ±2.145, we reject H₀. The central non-rejection region contains 1 − α = 0.95 of the area. Notice that as df increases, the t-distribution approaches the standard normal, and the critical values converge to ±1.96.

The diagram above illustrates the logic of a two-tailed t-test. When the computed t-statistic lands in either tail beyond the critical values, the observed sample mean is sufficiently far from μ₀ that such a result would be very unlikely under the null hypothesis. For a one-tailed test—where the alternative specifies a single direction—the entire α area is placed in one tail, making the critical value less extreme but limiting the test to detecting departures in only that direction. The choice between one-tailed and two-tailed tests should be determined by the research question before the data are examined, never in response to the observed results.

Mathematical Framework

The mathematical backbone of the one-sample t-test rests on the sampling distribution of the mean when the population standard deviation must be estimated from the data. We present the key formulas, connect them to the underlying distributional theory, and clarify the assumptions that make the procedure valid.

TEST STATISTIC
t = (x̄ − μ₀) / (s / √n)
where = sample mean, μ₀ = hypothesized population mean, s = sample standard deviation, n = sample size. The denominator s / √n is the estimated standard error of the mean.
SAMPLE STANDARD DEVIATION
s = √[ Σ(xᵢ − x̄)² / (n − 1) ]
The division by n − 1 (Bessel's correction) produces an unbiased estimator of σ². Using n − 1 also determines the degrees of freedom of the resulting t-distribution.
DEGREES OF FREEDOM
df = n − 1
Under H₀ and the assumption of normality, the test statistic t follows a Student's t-distribution with df = n − 1. As n → ∞, the t-distribution converges to the standard normal N(0, 1).

Assumptions

  • Random sampling: The observations are a simple random sample from the population of interest, ensuring independence.
  • Normality: The population distribution is approximately normal, or n is large enough (typically n ≥ 30) for the Central Limit Theorem to provide an adequate approximation.
  • Unknown σ: The population standard deviation is not known and must be estimated by s. If σ were known, a z-test would be appropriate instead.
⚠️ Robustness Note
The t-test is reasonably robust to mild departures from normality, especially when the sample size exceeds 30. However, it is sensitive to extreme outliers and heavy skewness in small samples. Always inspect a histogram, boxplot, or normal probability plot before relying on the t-test. For severely non-normal data with small n, consider the Wilcoxon signed-rank test as a nonparametric alternative.

Step-by-Step Testing Procedure

Performing a one-sample t-test follows a structured procedure that mirrors the general Neyman–Pearson framework for hypothesis testing. The flowchart below maps the decision points, and the detailed breakdown that follows explains each stage.

The flowchart shows the six-step procedure for conducting a one-sample t-test. Each colored box represents a stage: formulate hypotheses (violet), set significance level (cyan), verify assumptions (pink), compute the test statistic (amber), determine the p-value (emerald), and make a decision via the diamond decision node.

Detailed Breakdown of Each Step

Summary of the one-sample t-test procedure
StepActionKey Details
1State H₀ and HₐH₀: μ = μ₀. Choose Hₐ: μ ≠ μ₀ (two-tailed), μ < μ₀ (left-tailed), or μ > μ₀ (right-tailed) based on the research question.
2Select αCommon choices: 0.01, 0.05, or 0.10. Lower α reduces Type I error risk but increases Type II error risk.
3Verify assumptionsConfirm random sampling, check normality via histogram/QQ plot (or n ≥ 30), and ensure σ is unknown.
4Compute t and dft = (x̄ − μ₀) / (s / √n), df = n − 1.
5Determine p-valueUse a t-table or software. For two-tailed: p = 2 × P(T > |t|). For one-tailed: p = P(T > t) or P(T < t).
6Decision & conclusionIf p ≤ α → reject H₀ (evidence supports Hₐ). If p > α → fail to reject H₀ (insufficient evidence). State conclusion in context.

Worked Example

A nutritionist claims that the mean daily caloric intake of college students at a particular university is 2,100 calories. A health researcher doubts this claim and collects a random sample of n = 20 students. The sample yields a mean of x̄ = 2,240 calories with a sample standard deviation of s = 280 calories. At the α = 0.05 significance level, is there sufficient evidence to conclude that the true mean caloric intake differs from 2,100?

Two-Tailed One-Sample t-Test
1
Step 1 — State the HypothesesSince the researcher wants to determine if the true mean differs from 2,100 (without specifying a direction), we set up a two-tailed test. H₀: μ = 2100 and Hₐ: μ ≠ 2100.
2
Step 2 — Set Significance Level & Determine dfα = 0.05. The degrees of freedom are df = n − 1 = 20 − 1 = 19. For a two-tailed test at α = 0.05 with 19 df, the critical values from the t-table are approximately ±2.093.
df = 19, t* = ±2.093
3
Step 3 — Check AssumptionsThe sample is random; n = 20 is moderate, so we require approximate normality of the population. We assume the researcher verified this via a histogram or normal probability plot (no extreme outliers or severe skewness were noted). The population σ is unknown, confirming the t-test (rather than a z-test) is appropriate.
4
Step 4 — Compute the Test StatisticThe standard error is SE = s / √n = 280 / √20 = 280 / 4.472 ≈ 62.61. The t-statistic is t = (x̄ − μ₀) / SE = (2240 − 2100) / 62.61 = 140 / 62.61 ≈ 2.236.
t ≈ 2.236
5
Step 5 — Determine the p-ValueUsing a t-distribution table or software with df = 19, P(T > 2.236) ≈ 0.019. For a two-tailed test, the p-value = 2 × 0.019 = 0.038.
p ≈ 0.038
6
Step 6 — Decision and ConclusionSince p ≈ 0.038 < α = 0.05, we reject the null hypothesis. Equivalently, the test statistic t ≈ 2.236 exceeds the critical value t* = 2.093 in the right tail. There is sufficient evidence at the 5% significance level to conclude that the mean daily caloric intake of college students at this university differs from 2,100 calories. The data suggest the true mean is higher, with a point estimate of 2,240 calories.
Reject H₀ — evidence that μ ≠ 2100

t-Test vs. z-Test — Strengths & Limitations

Students often wonder when to use the t-test versus the z-test. The distinction is practical, not philosophical: both test the same type of hypothesis about a population mean, but they differ in what they assume about σ and, consequently, in the reference distribution they use. The table below summarizes the key comparisons, followed by a broader discussion of the t-test's strengths and limitations.

Comparison of the one-sample z-test and one-sample t-test
FeatureOne-Sample z-TestOne-Sample t-Test
Population σKnownUnknown (estimated by s)
Reference distributionStandard normal N(0, 1)Student's t with df = n − 1
Tail heavinessFixed, thin tailsHeavier tails for small df; approaches z as n → ∞
Critical values (α = 0.05, two-tailed)±1.960 alwaysLarger; e.g., ±2.262 (df = 9), ±2.045 (df = 29)
Practical useRare (σ seldom known)Very common in applied research
Sample size sensitivityUnaffected by n for the distribution shapeRequires normality check for small n; robust for large n
💡 PRACTICAL INSIGHT
In virtually every real-world application, you will use the t-test rather than the z-test, because population standard deviations are almost never truly known. The z-test appears in textbooks primarily as a pedagogical stepping stone—it introduces the logic of hypothesis testing in a simpler setting before the additional complexity of estimating σ is introduced. Once you master the t-test, the z-test becomes a special case: just substitute σ for s and use the standard normal distribution.

Limitations of the t-Test

  • Sensitivity to outliers: Because x̄ and s are both influenced by extreme values, a single outlier can distort the t-statistic and lead to incorrect conclusions.
  • Normality assumption: For small samples (n < 15), the test is unreliable if the population is strongly skewed or heavy-tailed.
  • Statistical vs. practical significance: A very large sample can yield a tiny p-value even when the difference x̄ − μ₀ is trivially small. Always report confidence intervals and effect sizes alongside the p-value.

Connections to Advanced Theory

The one-sample t-test is the simplest member of a large family of t-based procedures. Understanding it deeply prepares you for more complex settings—comparing two means, analyzing paired data, and conducting regression inference. The table below maps the one-sample t-test to its more advanced relatives, showing how the same underlying logic extends to richer designs.

How the one-sample t-test connects to advanced methods
ConceptOne-Sample t-TestAdvanced Extension
Number of groups1 (sample vs. hypothesized μ₀)2 (independent-samples t-test) or k (one-way ANOVA with F-test)
Paired dataNot applicablePaired t-test: apply one-sample t to the differences dᵢ = x₁ᵢ − x₂ᵢ
RegressionTests H₀: μ = μ₀Tests H₀: β = 0 for individual regression coefficients; t = b/SE(b)
Nonparametric analogAssumes normality (or large n)Wilcoxon signed-rank test: rank-based, no normality assumption
Bayesian versionFrequentist p-value decisionBayesian t-test: computes Bayes factor comparing H₀ to Hₐ

A particularly elegant connection exists between the one-sample t-test and the confidence interval for a mean. A two-tailed t-test at level α rejects H₀: μ = μ₀ if and only if the corresponding (1 − α) × 100% confidence interval x̄ ± t* × (s / √n) does not contain μ₀. This duality provides a powerful interpretive link: the confidence interval shows not just whether to reject, but the entire range of plausible values for μ given the data. In advanced coursework and research practice, reporting a confidence interval alongside the p-value is considered best practice because it conveys both statistical significance and the magnitude of the effect.

🚀 Looking Ahead
In subsequent courses, you will encounter the two-sample t-test (comparing means of two independent groups), the paired t-test (pre/post designs), and analysis of variance (ANOVA), which generalizes the t-test to three or more groups. The F-statistic in one-way ANOVA is, in fact, the square of the t-statistic when there are only two groups (F = t²). Mastering the one-sample t-test gives you the conceptual and computational foundation for all of these extensions.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why we use a t-distribution rather than a standard normal distribution when performing a hypothesis test for a population mean with an unknown population standard deviation. In your explanation, describe what happens to the t-distribution as the sample size increases.
PROBLEM 2BASIC CALCULATION
A manufacturer claims that the mean weight of its cereal boxes is 368 grams. A quality inspector randomly selects n = 25 boxes and finds x̄ = 364 g with s = 10 g. At α = 0.05, test whether the mean weight is less than 368 grams (left-tailed test). State your hypotheses, compute the test statistic, and determine the p-value.
PROBLEM 3INTERMEDIATE
A psychologist tests whether the mean reaction time for a stimulus is different from 250 milliseconds. She collects data from n = 16 participants and obtains x̄ = 262 ms with s = 20 ms. Conduct a two-tailed t-test at α = 0.01. Additionally, construct the 99% confidence interval for μ and verify that the hypothesis test result is consistent with the confidence interval.
PROBLEM 4APPLIED
An environmental agency claims that the mean dissolved oxygen level in a lake is 6.5 mg/L, which is considered healthy for aquatic life. An environmental scientist collects water samples at n = 12 randomly selected locations and measures dissolved oxygen levels (in mg/L): 5.9, 6.1, 6.3, 5.8, 6.0, 5.7, 6.4, 6.2, 5.6, 6.1, 5.9, 6.0. Test at α = 0.05 whether the mean dissolved oxygen level is below 6.5 mg/L. Discuss the practical significance of your findings.
PROBLEM 5CRITICAL THINKING
A researcher conducts a one-sample t-test with n = 400 and obtains t = 2.10 with p = 0.036, rejecting H₀: μ = 50 at α = 0.05. The sample mean is x̄ = 50.3 with s = 2.86. Critically evaluate this result. Is the finding practically meaningful? Compute Cohen's d and the 95% confidence interval to support your argument. Discuss the distinction between statistical significance and practical significance.

Summary

The one-sample t-test is a hypothesis testing procedure used to determine whether a population mean μ differs from a hypothesized value μ₀ when the population standard deviation σ is unknown. The test statistic t = (x̄ − μ₀) / (s / √n) follows Student's t-distribution with df = n − 1 under the null hypothesis, accounting for the additional uncertainty introduced by estimating σ with the sample standard deviation s. Developed by William Gosset in 1908 and formalized by R. A. Fisher, the t-test remains one of the most widely applied statistical procedures across the sciences.

The procedure follows a structured sequence: state H₀ and Hₐ, select a significance level α, verify assumptions (random sampling, approximate normality), compute the t-statistic, obtain the p-value, and make a decision—reject H₀ if p ≤ α, fail to reject otherwise. Key considerations include the distinction between statistical and practical significance, the duality between hypothesis tests and confidence intervals, and the robustness of the test to moderate normality violations when n is sufficiently large. The one-sample t-test serves as the foundational building block for the paired t-test, two-sample t-test, and regression inference.

Varsity Tutors • College Statistics • t-Test for a Mean — Hypothesis Test for a Mean (t-test)