The One-Sample t-Test

A conservation biologist measures beak depth in 18 finches from a remote island. The mean comes out to 9.4 mm. The mainland species this population supposedly descended from has a known mean beak depth of 8.9 mm. Is 9.4 mm truly different? Or could ordinary sampling noise produce a gap that size? This could happen even if the island population has the same true mean as the mainland. This is the exact question the one-sample t-test was built to answer. The problem is old and universal in biology. You rarely know a population parameter with certainty. You almost never measure the whole population. You measure a sample, get a mean, and must decide something important. You must decide whether that sample mean is compatible with some specific hypothesized value. This hypothesized value could be a historical average, a regulatory threshold, a theoretical prediction, or a value from the literature. The one-sample t-test formalizes this decision using the sample's own estimated variability. It does not assume you know the population's true standard deviation. The big picture is this: the test converts a difference between an observed mean and a hypothesized mean into a standardized number. This standardized number is a count of standard errors, called the t-statistic. The test then asks how extreme that number is under a specific null hypothesis. It does this using a reference distribution — the t-distribution. This distribution correctly accounts for the extra uncertainty of estimating variability from a small sample. William Sealy Gosset invented this correction in 1908. He worked under the pseudonym "Student" while analyzing tiny batches of barley and yeast data at the Guinness brewery. It remains one of the most heavily used tools in biological data analysis a century later. This article builds the one-sample t-test from first principles. It covers the logic of the t-statistic, and the shape and origin of the t-distribution. It also covers the assumptions the test requires, and the classical evidence that the method behaves as claimed. Finally, it includes two fully worked numerical examples — one ecological, one clinical — carried through to a final decision.

Key takeaways
  • The one-sample t-test compares a sample mean to one specific hypothesized value, μ₀.
  • The test statistic is t = (x̄ − μ₀) / SE, where SE = s/√n is the estimated standard error.
  • Under H₀, t follows a t-distribution with n − 1 degrees of freedom, not a normal distribution.
  • The t-distribution has heavier tails than the normal to account for uncertainty in estimating σ from s.
  • As n grows, the t-distribution converges to the standard normal (z) distribution.
  • The test assumes the sampled variable is approximately normally distributed and the observations are independent.
The core insight

The one-sample t-test measures how many estimated standard errors a sample mean lies from a hypothesized value, and judges that distance against the t-distribution — a normal-like curve deliberately fattened in the tails to punish the extra uncertainty of estimating spread from limited data.

The core idea

The one-sample t-test asks a single, precise question: given a sample of n independent observations drawn from some population, is the population mean μ plausibly equal to a specific pre-specified value μ₀? The null hypothesis is H₀: μ = μ₀. The alternative is typically two-sided, Hₐ: μ ≠ μ₀, though one-sided alternatives (μ > μ₀ or μ < μ₀) are used when there is a clear directional prediction stated before the data are examined. The test statistic is built from three ingredients that should already be familiar: the sample mean x̄, the hypothesized value μ₀, and the standard error of the mean, SE = s/√n, where s is the sample standard deviation and n is sample size. The t-statistic is:

t = (x̄ − μ₀) / SE = (x̄ − μ₀) / (s/√n) This is conceptually identical to a z-score — a signed distance in standard-error units — with one crucial difference. A z-score requires knowing the true population standard deviation σ. In real biological work, σ is essentially never known; it must be estimated from the same sample used to compute x̄, using s. Substituting an estimate (s) for a true parameter (σ) injects extra uncertainty, especially when n is small. Gosset showed that if you pretend this estimated t behaves like a z-score and judge it against the standard normal distribution, you will falsely reject true null hypotheses more often than your stated significance level allows — the test becomes anti-conservative. His solution was to derive the exact sampling distribution of this ratio when the data are drawn from a normal population: the t-distribution, indexed by degrees of freedom, df = n − 1. The degrees of freedom parameter controls how heavy the tails are. With few degrees of freedom (small n), the t-distribution is noticeably wider and flatter than the standard normal, reflecting genuine extra uncertainty about s as an estimate of σ. As df grows — practically, by around df = 30 the difference becomes small — the t-distribution converges to the standard normal curve, because s becomes a very precise estimate of σ. This single insight, that small samples need a fatter-tailed reference distribution, is why the t-test rather than a z-test is the default tool whenever σ is unknown, which is nearly always in biology.

Mechanism — how the test actually works, step by step

Step 1: State hypotheses and choose α. Before touching the data, specify H₀: μ = μ₀ and the alternative (two-tailed is the default and safest choice unless there is a strong, pre-registered directional prediction). Fix the significance threshold, conventionally α = 0.05.

Step 2: Check assumptions. The one-sample t-test assumes:

  • The n observations are independent (no repeated measures on the same individual counted as separate data points, no spatial or temporal autocorrelation among samples).
  • The underlying variable is drawn from a population that is approximately normally distributed, or n is large enough that the Central Limit Theorem makes the sampling distribution of x̄ approximately normal regardless of the raw data's shape.
  • The data are measured on an interval or ratio scale (a meaningful numeric mean must exist).

Step 3: Compute the sample statistics. From the n observations, calculate the sample mean x̄ and sample standard deviation s (using n − 1 in the denominator, the unbiased estimator of population variance).

Step 4: Compute the standard error and the t-statistic. SE = s / √n t = (x̄ − μ₀) / SE

Step 5: Determine degrees of freedom and find the critical value or p-value. df = n − 1. Using the t-distribution with that df, find either the critical t-value for the chosen α (for a fixed-threshold decision) or the exact two-tailed p-value corresponding to the observed t (the area in both tails beyond ±|t|).

Step 6: Decide. If the p-value is less than α (equivalently, if |t| exceeds the critical value), reject H₀: the sample mean is statistically significantly different from μ₀. Otherwise, fail to reject H₀ — the data are compatible with μ = μ₀, which is not the same as proving μ equals μ₀.

Step 7: Report effect size and a confidence interval. A p-value alone hides the magnitude of the difference. Always report the (1 − α) confidence interval for μ: x̄ ± t(df) × SE where t is the critical two-tailed t-value at the chosen confidence level. This interval directly shows the range of plausible population means and lets a reader see whether the difference from μ₀, if real, is biologically meaningful — not merely detectable.

Figure
Figure 1 — The t-distribution versus the standard normal, and how tail weight shrinks as df grows
0 t t, df = 2 (fat tails) t, df = 10 standard normal (z) Small df → wider, flatter curve → larger critical |t| needed for significance
Figure
Figure 2 — Anatomy of the one-sample t-test: from raw data to decision
Sample data n obs., x̄, s Hypothesis μ₀ from theory/lit. t = (x̄ − μ₀)/(s/√n) df = n − 1 t-distribution lookup p-value p < α ? Yes → reject H₀ No → fail to reject Also report: 95% CI for μ = x̄ ± t*(df) × SE — shows plausible range, not just significance.

The evidence — how we know the t-correction is necessary and correct

Gosset's brewery problem (1899–1908). William Sealy Gosset was a chemist at the Guinness brewery in Dublin, tasked with using small samples — often fewer than 10 batches — to judge whether changes in barley variety, malting temperature, or yeast strain affected beer quality. The standard practice of the era treated the sample standard deviation s as if it were the true σ and used the normal distribution (z-scores) to judge significance. Gosset noticed that with such tiny samples, this approach produced too many "significant" results that later failed to replicate — the normal-based test was too liberal because it ignored the extra uncertainty in estimating σ from only a handful of data points. Gosset worked out the exact sampling distribution of the quantity (x̄ − μ)/(s/√n) when sampling from a normal population, publishing it in Biometrika in 1908 under the pseudonym "Student" (Guinness forbade employees from publishing under their own names, fearing competitors would learn trade secrets from the statistical methods used). He derived the distribution partly analytically and partly by an early form of Monte Carlo simulation: he took height and left-middle-finger measurements from 3,000 criminals (data from a published anthropometric study), drew thousands of samples of size 4 by hand, computed the ratio for each, and tabulated the empirical distribution — confirming it matched his theoretical derivation.

What the simulation showed. When Gosset plotted the empirical distribution of his ratio, it was visibly wider and flatter than the standard normal curve — heavier in the tails — for small samples, and the discrepancy shrank as sample size increased. This directly demonstrated the core claim of the t-distribution: the correction for using s instead of σ is not a minor technicality but a substantial, quantifiable inflation of uncertainty at small n, one that disappears as n grows large.

Ronald Fisher's completion (1920s). Fisher recognized the general importance of Gosset's work, rigorously formalized the t-distribution in terms of degrees of freedom, extended it into the framework of ANOVA and regression, and popularized its use with tables that made the method practical for working scientists — cementing the t-test as a standard tool across agricultural, medical, and biological research.

Modern confirmation. Repeated simulation studies (routine today with computers, as Gosset first tried by hand) confirm that when the population is normal, the one-sample t-test controls the Type I error rate at exactly the nominal α across all sample sizes, whereas a z-test using s in place of σ rejects true null hypotheses too often, especially when n is below about 30. Simulation studies also establish the test's robustness: even when the underlying population departs modestly from normality (mild skew, or a symmetric heavy-tailed distribution), the t-test's Type I error rate stays close to nominal for moderate-to-large n, though it becomes unreliable for small n combined with strong skew — motivating the transformations and nonparametric alternatives covered under Assumptions & Data Transformations.

Worked examples

Example 1 — Ecology: island beak depth versus a mainland standard. A biologist wants to know whether an island population of finches has diverged in beak depth from the ancestral mainland mean of μ₀ = 8.9 mm, a value established from decades of mainland surveys and treated here as a fixed reference. Sample from the island: n = 18 birds.

StatisticValue
Sample mean, x̄9.4 mm
Sample SD, s0.90 mm
n18
df = n − 117

Standard error: SE = s/√n = 0.90/√18 = 0.90/4.243 = 0.212 mm t-statistic: t = (x̄ − μ₀)/SE = (9.4 − 8.9)/0.212 = 0.5/0.212 = 2.36 With df = 17, the two-tailed critical value at α = 0.05 is approximately t* = 2.11. Since the observed t = 2.36 exceeds 2.11, this falls in the rejection region; the exact two-tailed p-value is about 0.031.

Decision: Reject H₀ at α = 0.05. The island population's mean beak depth is statistically significantly different from the mainland value. 95% confidence interval for the true island mean: 9.4 ± 2.11 × 0.212 = 9.4 ± 0.447 → (8.95, 9.85) mm Note the interval barely excludes 8.9 mm — the result is significant but not by a wide margin, and a biologist should discuss whether a roughly 0.5 mm shift is ecologically meaningful (e.g., linked to seed-hardness differences on the island), not just statistically detectable.

Example 2 — Clinical: does a new formulation of a drug hit its target blood concentration? A pharmaceutical team reformulates a drug and needs its steady-state blood concentration to match the established therapeutic target of μ₀ = 150 ng/mL, the level shown in prior trials to be both effective and safe. Too high risks toxicity; too low risks under-dosing — so this is a genuine two-sided question. They measure steady-state concentration in n = 12 volunteers after the new formulation.

StatisticValue
Sample mean, x̄143.2 ng/mL
Sample SD, s14.6 ng/mL
n12
df = n − 111

Standard error: SE = 14.6/√12 = 14.6/3.464 = 4.214 ng/mL t-statistic: t = (143.2 − 150)/4.214 = −6.8/4.214 = −1.61 With df = 11, the two-tailed critical value at α = 0.05 is t* ≈ 2.20. The observed |t| = 1.61 is smaller than 2.20, so it does not fall in the rejection region; the two-tailed p-value is about 0.135.

Decision: Fail to reject H₀ at α = 0.05. There is not enough evidence to conclude the new formulation's mean concentration differs from the 150 ng/mL target. 95% confidence interval: 143.2 ± 2.20 × 4.214 = 143.2 ± 9.27 → (133.9, 152.5) ng/mL This is the more instructive case: "fail to reject" does not mean the formulation is proven equivalent to target. The interval spans from meaningfully low (133.9) to essentially on-target (152.5) — a wide range driven by the small n = 12. A responsible clinical reader would call for a larger trial before concluding bioequivalence, since this study is simply underpowered to rule out a clinically important shortfall.

Common misconceptions & traps

MisconceptionReality
"Failing to reject H₀ proves μ = μ₀."It only means the data are compatible with μ₀; the test cannot prove a null hypothesis, especially with low power (Example 2).
"A smaller p-value means a bigger, more important effect."p-value reflects both effect size and sample size; a tiny, trivial difference can be "significant" with large n. Always check the confidence interval and effect size.
"The t-test requires the raw data to look perfectly normal."It requires approximate normality, and by the Central Limit Theorem, large n makes the test robust even to skewed raw data — normality of the mean's sampling distribution is what matters.
"Any positive t means the sample mean is higher than μ₀ and significant."The sign only shows direction; significance depends on comparingtto the critical value (or p to α), which depends on df and the chosen α.
"One-sample and paired t-tests are different tools entirely."The paired t-test is a one-sample t-test performed on the column of within-pair differences, tested against μ₀ = 0 — same machinery, one extra data-reduction step (see The Paired t-Test).
"You can peek at the data, then decide one-tailed vs two-tailed."The direction of the alternative must be chosen before seeing the data; choosing it afterward inflates the effective Type I error rate.

The scientist behind it

William Sealy Gosset (1876–1937) trained as a chemist at Oxford, specializing in mathematics and chemistry, before joining Arthur Guinness & Son's brewery in Dublin in 1899 as one of the company's first scientifically trained brewers. His job was intensely practical: decide, from very small experimental batches, whether a change in raw materials or process genuinely altered beer quality, in an industry where experiments were expensive and slow, and where sample sizes of 4 to 10 were the norm rather than the exception. This constraint — small n, unknown σ — is precisely what pushed him to question the standard statistical practice of the day and derive a correction from scratch. Gosset was self-taught in advanced statistics beyond his Oxford training, and he corresponded extensively with Karl Pearson, who helped him refine and publish the 1908 paper "The Probable Error of a Mean" in Biometrika. Guinness's confidentiality policy forced him to publish as "Student," a pseudonym that stuck so firmly that the distribution is still called Student's t-distribution rather than Gosset's. He remained at Guinness his entire career, eventually managing a new Guinness brewery in London, and continued to correspond with and influence Ronald Fisher, who built the t-distribution into the broader edifice of modern statistical inference.

Origins · 1 minWilliam Sealy Gosset and how this was discovered
WS
William Sealy Gosset
1876–1937 · Chemist and statistician at the Guinness brewery, Dublin; publishing pseudonymously as "Student," he derived the t-distribution to correct small-sample inference, founding what is now the one-sample and two-sample t-test framework used throughout biology and medicine.

History
- 1899 — Gosset joins Guinness brewery in Dublin as a brewer-scientist.
- 1904–1906 — Gosset studies statistics with Karl Pearson at University College London; begins working out the small-sample distribution problem.
- 1908 — Publishes "The Probable Error of a Mean" in Biometrika under the pseudonym "Student," introducing the t-distribution.
- 1920s — Ronald Fisher formalizes degrees of freedom and integrates the t-distribution into general statistical theory, including ANOVA.
- 1937 — Gosset dies; the t-distribution and t-test are by then standard tools across agricultural and biomedical statistics.

Where this matters today

The one-sample t-test remains a workhorse across biology and medicine wherever a single sample mean must be checked against an established, externally fixed benchmark. In clinical pharmacology, it is used to test whether a drug's measured pharmacokinetic parameter (clearance, half-life, steady-state concentration) matches a regulatory target, as in Example 2; bioequivalence testing extends this logic further with specialized equivalence-testing procedures. In conservation biology and ecology, it is used to test whether a population trait — body size, clutch size, migration timing — has shifted from a historically documented baseline, informing decisions about whether a population is responding to climate change or habitat disturbance. In agriculture, it tests whether a new crop variety's yield, protein content, or drought tolerance matches a specified target set by breeders or regulators. In public health, it is used to test whether a population's biomarker mean (blood lead level, BMI, blood pressure) matches a safety threshold set by health authorities, directly informing regulatory and intervention decisions. The test's deeper importance is pedagogical and structural: it is the simplest member of the entire t-test family, and understanding its logic — a standardized difference judged against a distribution that accounts for estimation uncertainty — is the direct foundation for the Two-Sample t-Test (comparing two independent group means) and the Paired t-Test (comparing linked measurements within subjects). Every more advanced linear model, from ANOVA to multiple regression, ultimately reports t-statistics for its coefficients built on exactly this logic.

Ask the tutor: How does the one-sample t-test's logic extend when comparing two independent group means in the two-sample t-test?

What is the difference between a one-sample t-test and a z-test for a single mean?

Both compute a standardized distance between a sample mean and a hypothesized value, but a z-test requires knowing the true population standard deviation σ, while a t-test uses the sample standard deviation s as an estimate of σ. Because s is itself uncertain, especially with small n, the t-test judges the resulting ratio against the t-distribution, which has heavier tails than the normal distribution used for z-tests. As sample size grows large (roughly n > 30), s becomes a very precise estimate of σ, and the t-distribution converges to the normal distribution, making the two tests give nearly identical results. In practice, σ is almost never known in biological research, so the one-sample t-test is used far more often than the z-test.

Does the one-sample t-test require the raw data to be perfectly normally distributed?

No — it requires the sampling distribution of the mean to be approximately normal, which is a milder requirement. By the Central Limit Theorem, the sampling distribution of x̄ approaches normality as n increases, even if the raw data are moderately skewed or non-normal, so the t-test is reasonably robust for larger samples. For small samples (roughly n < 15–20) with strongly skewed or heavy-tailed raw data, the test's Type I error rate can become unreliable, and a transformation of the data or a nonparametric alternative (like the Wilcoxon signed-rank test) becomes preferable, a topic developed further under Assumptions & Data Transformations.

What does "degrees of freedom" mean in this context, and why is it n − 1?

Degrees of freedom (df) indexes which specific t-distribution curve applies, controlling how heavy its tails are. For a one-sample t-test, df = n − 1 because calculating the sample standard deviation s requires first calculating the sample mean x̄, which imposes one constraint on the n deviations from that mean (they must sum to zero). Once you know n − 1 of the deviations, the last one is determined, leaving only n − 1 independent pieces of information to estimate variability. Smaller df means fewer independent pieces of information about spread, hence a wider, flatter t-distribution and a larger critical value needed to declare significance.

Why should I always report a confidence interval alongside the p-value?

The p-value only answers a yes/no question about whether a difference is detectable given the noise and sample size; it says nothing about how large or biologically important that difference is. A confidence interval for μ directly expresses a plausible range for the true population mean, in the original units of measurement, letting a reader judge both statistical and practical significance simultaneously. It's entirely possible to have a statistically significant result (small p-value) attached to a confidence interval so narrow that the effect is trivial, or a non-significant result attached to a wide interval that still includes biologically important values — as seen in the clinical drug example. Reporting both prevents readers from over-interpreting a bare p-value.

Can the one-sample t-test be one-tailed instead of two-tailed?

Yes, if there is a specific, biologically justified directional prediction made before looking at the data — for example, testing only whether a new fertilizer increases yield above a known baseline, never decreases it. A one-tailed test places the entire rejection region in one tail, making it more powerful for detecting an effect in the predicted direction, but it comes at the cost of being unable to detect (or even acknowledge) a significant effect in the opposite direction. Because this choice must be locked in before data collection to remain valid, and because most biological questions genuinely admit effects in either direction, the two-tailed test is the conservative and far more common default in practice.

How does the one-sample t-test relate to the paired t-test?

The paired t-test is mathematically identical to a one-sample t-test performed on a derived variable: the set of differences between paired measurements (for example, before-minus-after values within the same individuals). Once those differences are calculated, the paired t-test simply tests whether their mean differs from μ₀ = 0, using exactly the same t = (d̄ − 0)/(s_d/√n) formula and the same t-distribution logic with df = n − 1 pairs. Recognizing this connection is useful conceptually: any time repeated or matched measurements can be reduced to a single column of differences, the entire one-sample t-test machinery applies directly, as detailed further under The Paired t-Test.

What sample size do I need for a one-sample t-test to be reliable?

There is no universal minimum, but as a practical guideline, n ≥ 30 is often cited as the point where the t-distribution closely approximates the normal distribution and the Central Limit Theorem provides strong robustness against non-normal raw data. For smaller samples (n between about 10 and 30), the test remains valid provided the underlying population is reasonably symmetric and not strongly skewed or heavy-tailed. For very small samples (n < 10), the test is highly sensitive to violations of the normality assumption, and biologists should inspect the data visually (histograms, Q–Q plots) and consider nonparametric alternatives if normality looks doubtful. Sample size also strongly affects statistical power — as Example 2 shows, a small n can fail to detect a real and important difference.

Before this

Where this leads