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.
Quick answer: How do you run a one-sample t-test in SPSS?
- Click Analyze › Compare Means › One-Sample T Test.
- Move the outcome into Test Variable(s).
- 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.
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
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.
- sleep.savHours of sleep per night (N = 40)
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.