Skip to content
Tutorials Center
My learning

Topics

Lesson 22 of 39 ยท Hypothesis Tests

One-Sample t Test in SPSS

Run and interpret the one-sample t test in SPSS: the menu path, syntax, reading the output tables, the confidence interval, Cohen's d and how to write it up.

The one-sample t test asks whether the mean of one group differs from a known or claimed value. Is the average delivery time different from the promised 30 minutes? Does this class score differently from the national mean of 70? It is the simplest test in the chapter, so it is a good place to learn how SPSS output is organized.

When to use it

  • One scale variable measured in one sample.
  • A fixed test value from outside the data (a standard, a target, a previous census).
  • Observations independent, and the variable roughly normal (or n around 30 or more).

If the value you compare with comes from another group in your data, you need the independent-samples t test instead.

The idea

The test measures how far the sample mean is from the test value in units of its standard error:

t = (mean - test value) / (s / sqrt(n)), with n - 1 degrees of freedom.

A large |t| means the sample mean is many standard errors from the test value, which is unlikely if the population mean really equals it.

Python Stand-in: the one-sample t test by hand

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Running it in SPSS

  1. Make sure the variable is defined as Scale in Variable View.
  2. Choose Analyze > Compare Means > One-Sample T Test.
  3. Move the variable into Test Variable(s).
  4. Type the claimed value in Test Value (30 in our example).
  5. Click Options and keep the confidence level at 95%. Missing values: "Exclude cases analysis by analysis" is the default and is right unless you test several variables.
  6. Click OK, or Paste to see the syntax:
Text
T-TEST
  /TESTVAL=30
  /MISSING=ANALYSIS
  /VARIABLES=delivery_minutes
  /CRITERIA=CI(.95).

Reading the output

SPSS produces two tables (and, from version 27, a third with effect sizes).

One-Sample Statistics gives N, Mean, Std. Deviation and Std. Error Mean. Check N first: it should match the number of valid cases you expect.

One-Sample Test repeats the test value in its header and shows:

Column Meaning
t The test statistic
df N - 1
Sig. (2-tailed) or Two-Sided p The p value
Mean Difference Sample mean minus test value (a signed number)
95% Confidence Interval of the Difference Lower and Upper bounds of the plausible true difference

Note that the interval is for the difference, not for the mean itself. To get the interval for the mean, add the test value to both bounds. If the interval for the difference excludes 0, the result is significant at .05.

One-Sample Effect Sizes (version 27+) lists Cohen's d and Hedges' correction with confidence intervals. In older versions, compute d yourself: d = mean difference / standard deviation.

Python Stand-in: effect size and confidence interval

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Rough guide for Cohen's d: 0.2 small, 0.5 medium, 0.8 large. These are conventions, not laws; judge size against what matters in your field.

Checking assumptions

  • Histogram or Q-Q plot of the variable (Analyze > Descriptive Statistics > Explore).
  • With a small sample and clear skew or outliers, use the one-sample Wilcoxon test instead. In SPSS: Analyze > Nonparametric Tests > One Sample, then the Customize Analysis option "Compare median to hypothesized (Wilcoxon signed-rank test)". See non-parametric tests.

Writing it up

"The mean delivery time (M = 32.6, SD = 3.3, n = 15) was significantly longer than the promised 30 minutes, t(14) = 3.06, p = .009, 95% CI of the difference [0.8, 4.4]." (These are the numbers from the first stand-in above.)

Always give the descriptive statistics, the t value with its df, the p value, and the interval or effect size. Use your own output numbers for real data.

Common mistakes

  • Reading the confidence interval as an interval for the mean (it is for the difference).
  • Forgetting to change the Test Value from the default 0, which tests the mean against zero and is rarely what you want.
  • Using it to compare two groups from your own data.
  • Quoting "p = .000".

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In SPSS, where do you enter the claimed population value?

    The Test Value box holds the value your sample mean is compared with. Its default of 0 is rarely appropriate.
  2. 2. With N = 20, what are the degrees of freedom of a one-sample t test?

    df = N - 1 = 19.
  3. 3. The 95% CI of the difference is [0.8, 3.2]. What follows?

    An interval that excludes 0 corresponds to p < .05 for the two-sided test.
  4. 4. Which test replaces it when the data are strongly skewed and n is small?

    It compares the median with the test value without assuming normality.

Summary

  • The one-sample t test compares a sample mean with a fixed value.
  • Menu: Analyze > Compare Means > One-Sample T Test; set Test Value.
  • Read t, df, Sig., Mean Difference and the CI of the difference; add Cohen's d.
  • Check normality; fall back to Wilcoxon for skewed small samples.

Next: Independent-Samples t Test