Analyze · Means

One-Sample t-Test

Compares the mean of one continuous variable to a hypothesized population mean (μ₀).

In the menus Analyze › Means › One-Sample t-Test

Also searched as single sample t test 1 sample t one sample mean test test a mean against a value compare mean to a target

When to use it

You want to compare a sample mean to a known/target value.

When not to: The data are severely non-normal at a small sample size (use the Wilcoxon signed-rank test against mu0 instead), you have two related measurements to compare rather than one measurement against a fixed reference (use the paired t-test), or you intend to choose the test direction (greater/less/two-sided) AFTER looking at which direction the sample happens to favor.

Step by step

  1. Open it from the menu

    Click Analyze in the menu bar; under Means choose One-Sample t-Test.

  2. Fill in the form

    Choose the columns: What you measured. The form lists only columns whose type fits each field.

  3. Check the options

    The options start at their defaults: Value to compare with, How strict to be, What you expect, How sure the range is. Change one only when your question needs it.

  4. Run the analysis

    Press Run analysis. The Result Card opens on its Results tab.

What to choose in the form

Fields of the One-Sample t-Test form
What you measured Numeric Var requiredOne numeric column. A number column. The test compares its average with the value you type below.
Value to compare with μ₀ (hypothesized mean)The average your question is about, such as a target or a published value, like 4000 grams. Change this: 0 is only a placeholder. Type the value your question is about.
How strict to be AlphaThe cut-off for the p-value. Below it, the card reports evidence of a difference; a smaller cut-off is stricter. Not sure? Keep 0.05. It is the usual convention in most fields.
What you expect Alternativetwo-sided: different from the value in either direction. less: lower than it. greater: higher. Choose a direction only if decided beforehand. Not sure? Keep two-sided. It is the usual choice because it does not assume a direction.
How sure the range is Confidence levelThe confidence level of the range for the mean: 0.95 gives a 95% confidence interval. Not sure? Keep 0.95. It is the usual choice and matches a 0.05 cut-off.

How to read the card

The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.

What it assumes

Independence of observations

If it does not hold: Correlated observations (repeated measurements on the same unit, or a time-ordered series) make the standard error too small, so the p-value is too small and the confidence interval too narrow, regardless of what the normality check shows.

How to check: Not checkable from the data alone: it is a property of how the data were collected.

Normality (of residuals, not of the raw data)

If it does not hold: At small n, strong skew or outliers distort both the p-value and the confidence interval; at moderate to large n the Central Limit Theorem makes the test fairly robust.

How to check: Shapiro-Wilk for 3 <= n <= 5000, and Anderson-Darling for n >= 8 (becoming the primary verdict above n = 5000, where Shapiro-Wilk is skipped), both reported directly on the card.

A worked example

Testing whether the average resting heart rate of 60 patients differs from a clinical benchmark of 72 bpm.

Result: t(59) = 2.84, p = .006, mean = 75.1 bpm, 95% CI [72.9, 77.3], Cohen's d = 0.37 (small-to-medium).

The sample mean is significantly above the 72 bpm benchmark, and the confidence interval places the true average somewhere between about 72.9 and 77.3 bpm, a modest but real elevation above the benchmark, with the small-to-medium effect size cautioning against over-interpreting the clinical significance of a roughly 3 bpm difference.

From the Statistics Library.

The code tabs

Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.

Understand the statistics

Ask Oobi

Type one of these into Ask Oobi beside your data:

  • Is the average resting heart rate of our patients different from 72 bpm?
  • Explain the one-sample t-test in plain words.
  • What does Student's t distribution mean?

Last reviewed November 16, 2026.

Report an unclear step