- Introduced by
- Student (W. S. Gosset)
- Year
- 1908
- Type
- Parametric mean comparison
- Family
- Classical statistics
What does it do?
The one-sample t-test is a parametric hypothesis test that determines whether the mean of a single sample differs significantly from a known or hypothesized population value.
Derived from Student's (Gosset's) 1908 t-distribution, it assumes continuous, approximately normally distributed data and is one of the most fundamental tests in applied statistics.
The intuition behind the method
Imagine measuring the average recovery time of patients at your clinic and wanting to know whether it differs from the national benchmark of 14 days. The one-sample t-test answers this by comparing your sample mean to the benchmark value, then asking: how often would you see a gap this large purely by chance if the true mean were 14? If that probability is very small, the departure from the benchmark is judged statistically significant.
History
The t-distribution behind this test was derived by William Sealy Gosset, writing as 'Student', in his 1908 Biometrika paper 'The Probable Error of a Mean'. That paper addressed how to judge the significance of a sample mean when the sample is too small for the normal curve to be trusted. It gave the distribution of the standardised distance between a sample mean and a population mean, which is the basis for the one-sample test. The one-sample test is the simplest use of that framework: a sample mean is compared with a fixed value using the sample standard deviation.
When to use it
Use the one-sample t-test when you have a single group of continuous (interval or ratio) observations and want to compare its mean with a fixed reference value that was specified before data collection, such as a legal limit, a published norm, a theoretical prediction, or a historical average. The observations should be independent of one another and approximately normally distributed. Check normality with a Q-Q plot or the Shapiro-Wilk test, bearing in mind that normality tests have limited power in small samples. Do not use this test when the reference value is itself estimated from a second set of data. In that case you are comparing two samples, and the independent-samples or paired-samples t-test is the appropriate family. Do not use it for ordinal scales or for strongly skewed data in small samples, where the Wilcoxon signed-rank test is the usual alternative. It is also not designed for comparing more than two groups.
Limitations and considerations
- Assumes approximately normal observations; in small samples drawn from skewed or heavy-tailed distributions the t-based p-values may not be accurate.
- The reference value must be fixed in advance. If it is estimated from another sample, the variability of that estimate is ignored, the standard error in the statistic is understated, and the test no longer has its nominal error rate.
- Sensitive to outliers: one extreme value changes both the mean and the standard deviation, and can either hide a real shift or create an apparent one.
- The statistic depends only on the sample mean and standard deviation, so it says nothing about distribution shape. A significant result does not show that the whole distribution has moved.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Requires only one sample and one reference value, so the hypotheses and the data needed to test them are simple to state and check.
- When the normality assumption is reasonable, the statistic uses the sample standard deviation directly in the standard error, which makes it a sensitive test of a shift in the mean at moderate sample sizes.
- Standard software provides a 95% confidence interval for the mean difference by default, and Cohen's d (the mean difference divided by the sample standard deviation) can be calculated from the same output, so the size of the departure from the reference is reported alongside the p-value.
- The test is implemented in standard statistical software, so a result can be reproduced with a different tool.
- For larger samples the sampling distribution of the mean tends toward normality (central limit theorem), so moderate departures from normality in the raw data have a smaller effect on the test's error rates. This robustness does not extend to heavy-tailed or strongly skewed populations, which still require larger samples, and it does not protect the test against outliers.
Applications
- Checking whether a production batch meets a regulatory or quality standard (e.g., average weight equals 500g).
- Comparing a clinical group's mean score against a published population norm (e.g., IQ = 100, anxiety scale norms).
- Verifying that a measurement instrument is calibrated to a known reference value.
- Testing whether a new teaching program moves student performance away from a historical benchmark.
- Evaluating whether average response times in a system meet a specified service-level target.
- Assessing whether the mean of a sampled environmental measurement (e.g., pollutant concentration) exceeds a safety limit.
How it works
How it works
The null hypothesis states that the population mean equals a pre-specified constant (the test value, such as a benchmark or theoretical value). The alternative hypothesis states that the population mean is different from, or, if directional, greater or less than, that constant.
Formula
H_0:\ \mu = \mu_0 \quad H_1:\ \mu \neq \mu_0
The t statistic equals the difference between the sample mean and the hypothesized value, divided by the standard error of the mean (sample standard deviation divided by the square root of sample size). Larger gaps or larger samples push the t value further from zero, increasing evidence against the null.
Formula
t = \dfrac{\bar{x} - \mu_0}{s / \sqrt{n}}Degrees of freedom equal n minus 1, where n is the sample size. This determines which row of the t-distribution table to use when computing the p-value. Larger samples yield more degrees of freedom and a distribution that more closely resembles the normal.
Formula
df = n - 1
If the two-tailed p-value falls below the chosen alpha level (typically 0.05), the null hypothesis is rejected and the sample mean is concluded to differ from the test value. Standard software reports a two-tailed p-value by default. For a one-tailed test, the directional hypothesis must be specified before data collection, and the one-sided p-value must be reported explicitly. Report the mean difference, its 95% confidence interval, and Cohen's d (the mean difference divided by the sample standard deviation) as an effect-size measure.
Formula
\text{reject } H_0 \text{ if two-tailed } p < \alpha;\quad d = \dfrac{\bar{x} - \mu_0}{s}Common pitfalls
- Choosing the reference value after seeing the data. This turns a confirmatory test into a search for a convenient comparison and invalidates the nominal p-value.
- Reporting only the p-value. The mean difference, its confidence interval and Cohen's d show how large the departure from the reference value is.
- Applying the test to ordinal scales, such as Likert items with few categories, without checking that the scores can reasonably be treated as continuous.
- Treating a non-significant normality test as proof of normality in small samples, where such tests have limited power. Inspect a Q-Q plot, and consider the Wilcoxon signed-rank test if the shape is clearly non-normal.
- Analysing pre-post measurements as two independent groups, which ignores the pairing. Testing the difference scores against zero with this test gives the same statistic as the paired t-test, so the choice depends on the study design, not on the arithmetic.
Frequently asked questions
What is the 'test value' and how do I choose it?
The test value (also called mu-zero) is the hypothesized population mean, a fixed number derived from theory, regulation, a published norm, or a historical record. It must be specified before data collection. Common examples are a national test-score average, a legal threshold, or a manufacturing specification.
When should I switch to the Wilcoxon signed-rank test?
Choose between the t test and the Wilcoxon signed-rank test from the measurement scale and the expected shape of the data, and fix that choice before analysing the data. The Wilcoxon signed-rank test is the usual alternative for ordinal scales and for clearly skewed or heavy-tailed data, particularly in small samples. Whether the data are of that kind should be judged from a Q-Q plot and from knowledge of the variable, not from a normality test run on the same data and used to decide which test to report. The Wilcoxon signed-rank test assumes that the differences from the reference value are symmetric about zero. Under that assumption it addresses the median, which equals the mean when the distribution is symmetric.
Can I use the one-sample t-test for a one-tailed hypothesis?
Yes. If you predict a directional difference before seeing the data (e.g., the mean will be greater than the norm), a one-tailed test places the whole rejection region in that direction, so it is more powerful for that direction. It cannot reject the null in the opposite direction at the same alpha, so a large effect the other way would go undetected. Use one-tailed tests only when the direction is justified a priori.
How is this different from the paired samples t-test?
In the paired t-test you compute the difference score for each participant (e.g., post minus pre) and then test whether that difference mean equals zero, which is essentially a one-sample t-test on difference scores. The paired t-test is appropriate when each observation has two related measurements; the one-sample t-test is used when you compare one set of observations against a fixed external value.
What effect size should I report?
Cohen's d is the usual choice: divide the difference between the sample mean and the test value by the sample standard deviation. Conventional benchmarks treat values around 0.2 as small, 0.5 as medium and 0.8 as large, but these are rough guides rather than thresholds for practical importance. Also report the 95% confidence interval for the mean difference to convey estimation precision.
Related methods
Sources
Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25.
Open DOI referenceField, A. (2013). Discovering Statistics Using IBM SPSS Statistics (4th ed.). SAGE.
ISBN: 978-1446249185Applied Statistics: From Bivariate Through Multivariate Techniques, 2nd Edition, p. 142–143