Unit 9 · Same people, several times

How to run a one-sample t-test in SPSS

Compare a sample mean with a known value using the one-sample t-test in SPSS, and report t, df, p and Cohen’s d.

Free tutorialPro practiceAbout 5 minutes6 practice questions

Quick answer: How do you run a one-sample t-test in SPSS?

  1. Click Analyze › Compare Means › One-Sample T Test.
  2. Move the outcome into Test Variable(s).
  3. Type the comparison value in Test Value and click OK.

Report it in APA style: Students slept less than the recommended 8 hours (M = 7.10, SD = 1.20), t(39) = −4.74, p < .001, d = 0.75.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

What is a one-sample t-test?

A one-sample t-test compares the mean of one group with a fixed value, such as a published norm, a scale midpoint or a recommended level.

When to use it

  • One sample and one Scale outcome.
  • A meaningful comparison value from outside your data.

How it works

t = (sample mean − test value) ÷ (SD ÷ √n). The degrees of freedom are n − 1. Cohen’s d = (mean − test value) ÷ SD. The confidence interval for the mean difference shows the range of plausible differences from the test value.

Assumptions

  • The outcome is Scale and roughly normal.
  • Independent observations.

Worked example

Students slept 7.10 hours on average (SD = 1.20), significantly less than the recommended 8 hours, t(39) = −4.74, p < .001, d = 0.75.

Key terms

Test value
The fixed number the mean is compared with.
Mean difference
Sample mean minus test value.

Common mistakes

  • Leaving the test value at 0.
  • Comparing two groups with it (use the independent t-test).

How to do it in SPSS

One-Sample T Test

Compare one group’s mean with a known value, such as students’ average sleep against the recommended 8 hours.

One-Sample T Test
Variables
Participant ID [id]
Age in years [age]
▶
Test Variable(s):1
Hours of sleep [sleep]
Test Value: 82
Options…Bootstrap…
✓Estimate effect sizes3
OKPasteResetCancelHelp
  1. 1
    Test Variable(s)The Scale variable you’re testing.
  2. 2
    Test ValueThe number you’re comparing against: a norm, a scale midpoint or a published average. It is 0 by default, which is rarely what you want.
  3. 3
    Estimate effect sizesSPSS 27 and later can give Cohen’s d for you.

Reading one-sample output

Two small tables: the sample’s mean, then the test against your value.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
T-Test
One-Sample Statistics
One-Sample Test
One-Sample Effect Sizes
One-Sample Statistics
NMeanStd. DeviationStd. Error Mean
sleep407.1011.20.19
One-Sample Test · Test Value = 8
tdfTwo-
Sided p
Mean
Difference
95% CI
Lower
95% CI
Upper
sleep−4.74239<.001−0.903−1.28−0.52

Cohen's d = −0.75

  1. 1
    MeanStudents slept 7.10 hours on average.
  2. 2
    tNegative because the mean is below the test value. Report it with df = N − 1 = 39.
  3. 3
    Mean DifferenceMean minus test value: 7.10 − 8 = −0.90 hours. The 95% CI (−1.28 to −0.52) doesn’t include 0.

The SPSS syntax

Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.

T-TEST
  /TESTVAL=8
  /VARIABLES=sleep
  /ES DISPLAY(TRUE)
  /CRITERIA=CI(.95).

Practice data

Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.

Now practise it interactively →

Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 6 quick questions, with instant feedback on every answer.

Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.

More in Same people, several times