One-sample t-test
Compares the mean of a measurement in one group with a fixed reference value that was specified in advance.
Statistically reviewed by Daniel Wolff on 1 November 2026.
Clinical example
Whether the mean HbA1c of the patients in your diabetes clinic differs from the target value of 53 mmol/mol. One measurement per patient, one group of patients, and one fixed reference value.
When to use it
- The outcome is a measurement on a continuous scale, one value per patient.
- You have one group and a fixed reference value, specified before you look at the data, to compare its mean with.
- The mean of your sample is roughly normally distributed: the data are roughly normal, or the sample is large enough for how skewed the data are.
Assumptions to check
Independent observations
One value per patient, and patients who are independent of each other. No clustering by ward or surgeon, and no repeat admissions of the same patient counted as separate observations.
Roughly normal, or a large enough sample
Look at a histogram or Q-Q plot. With moderate sample sizes, mild skew is usually acceptable. With strong skew (for example length of stay or costs) you need a much larger sample, or a different approach. This is the least skew-robust of the t-tests.
No extreme outliers
The mean and SD are not robust. A single extreme value, such as one 90-day stay, can drive the result.
A fixed reference value that fits your data
The value you compare with must not have been estimated from the same data, and it must be chosen before you look at the data. It must measure the same quantity in a comparable population: the same definition, the same kind of summary (a mean, not a median) and a comparable case mix. If the reference comes from another study and is itself uncertain, it is not fixed.
A representative sample
The sample represents the population the reference value applies to.
What to report
- Mean and SD, and the number of patients actually analyzed (after missing values)
- The reference value and its source
- The difference from the reference value with its 95% CI
- The t statistic, the degrees of freedom (n - 1) and the exact p-value
- That the test was two-sided
Common mistakes
Using the test while the reference value was estimated from the same data.
Using it on clearly skewed data with a small sample.
Comparing with a reference that is a median or a geometric mean, or that uses a different definition or population.
Treating several observations of the same patient as independent.
Reading a non-significant result as no difference or as equal to the national average. That needs an equivalence approach, or at least a look at the width of the CI.
Choosing a one-sided test, or the reference value, after seeing the data.
Reading a difference from a national average as a difference in quality without considering case mix.
Alternatives
| If your situation is… | Use |
|---|---|
| Clearly skewed data, especially with a small sample. The sign test compares the median, so the reference must be a median too. The Wilcoxon signed-rank test assumes symmetric data | Sign test or Wilcoxon signed-rank test |
| Skewed, always-positive data, and the reference is a geometric mean (analysis on the log scale) | Unpaired t-test on log-transformed data |
| The reference value comes from another study and is itself uncertain | Welch's t-test |
In your software
# R (mu is the reference value)
x <- d$hba1c
res <- t.test(x, mu = 53)
res # the CI printed here is for the mean, not for the difference
res$estimate - 53 # mean difference
res$conf.int - 53 # 95% CI of the difference
sd(x, na.rm = TRUE)
sum(!is.na(x)) # n actually analyzed: t.test drops missing values silently
* SPSS reports the mean difference with its 95% CI.
T-TEST
/TESTVAL=53
/VARIABLES=hba1c
/CRITERIA=CI(.95).
Sources
An interval without assuming normality
For skewed data, when the mean itself is what you need (for example length of stay or costs), a bootstrap confidence interval for the mean assumes less than the t-test. It does not rescue a very small sample.