Skip to content
Tutorials Center
My learning

Topics

Lesson 39 of 39 ยท Projects and Practice

SPSS Practice Exercises: Choose, Run and Interpret

Twelve SPSS exercises with answers: pick the right test, write the syntax, read output snippets, spot mistakes and report results. Includes a self-marking drill.

Reading about statistics is not the same as using it. This lesson is a practice set: for each scenario decide what to do, write the syntax or menu path, and check your answer. Cover the answer, think, then compare. The scenarios cover the full chapter on hypothesis tests, regression, charts and syntax.

Part 1: choose the test

For each scenario name the variable types, the design and the SPSS test.

  1. A clinic measures blood pressure in the same 40 patients before and after a diet.
  2. A shop compares average basket size for customers with and without a loyalty card.
  3. A school compares exam scores across four classes.
  4. A survey asks respondents for their region and their preferred phone brand.
  5. A researcher asks whether age predicts reaction time.
  6. An analyst predicts whether a customer cancels (yes/no) from tenure and monthly bill.
  7. Satisfaction on a 1-5 scale is compared between two small groups with skewed answers.
  8. Does average income differ from the national figure of 36,000?
Python Stand-in: self-marking test chooser drill

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.

The answers in the code are the model solutions (change the my_answers list to test yourself first). Relevant lessons: choosing the right test, paired t test, independent t test, one-way ANOVA, chi-square, simple regression, logistic regression, non-parametric tests, one-sample t test.

Part 2: write the syntax

  1. Write the command for an independent-samples t test of score by group (codes 1 and 2).
  2. Write a command for a crosstab of region by brand with chi-square, expected counts and row percentages.
  3. Reverse-score q3 on a 1-5 scale into q3_r and compute the mean of q1, q2, q3_r requiring all three.
  4. Run a linear regression of post on pre and age, with collinearity statistics and residual plots.

Model answers:

Text
* 9.
T-TEST GROUPS=group(1 2) /VARIABLES=score /CRITERIA=CI(.95).

* 10.
CROSSTABS /TABLES=region BY brand
  /STATISTICS=CHISQ PHI
  /CELLS=COUNT EXPECTED ROW.

* 11.
COMPUTE q3_r = 6 - q3.
COMPUTE scale = MEAN.3(q1, q2, q3_r).
EXECUTE.

* 12.
REGRESSION
  /STATISTICS COEFF OUTS CI(95) R ANOVA COLLIN TOL
  /DEPENDENT post
  /METHOD=ENTER pre age
  /SCATTERPLOT=(*ZRESID ,*ZPRED)
  /RESIDUALS HISTOGRAM(ZRESID) NORMPROB(ZRESID).

Part 3: spot the mistake

Each statement has an error. Find it.

  • A: "Levene's test was significant (p = .01), so I read the Equal variances assumed row."
  • B: "The ANOVA was not significant, but I ran Tukey tests anyway and reported the one pair with p = .04."
  • C: "r = .62, so changes in X cause 62% of the changes in Y."
  • D: "SPSS says Sig. = .000, so p = 0."
  • E: "I ran SELECT IF, saved over the original file and lost my other cases."
  • F: "I forgot the period at the end of the command, but the next command still ran fine."

Answers: A: should read the not-assumed (Welch) row. B: post hoc after a non-significant omnibus test is fishing. C: correlation is not causation, and r squared (.38) is shared variance. D: report p < .001. E: SELECT IF deletes cases from the working data; save under a new name or use FILTER. F: the missing period merges two commands, so the second one was probably swallowed or raised an error.

Python Stand-in: check your effect size and p formatting

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.

Part 4: read this output

Imagine SPSS printed an independent-samples test with Levene F = 0.4, Sig. = .53; in the Equal variances assumed row t = 2.9, df = 38, Sig. (2-tailed) = .006, Mean Difference = 4.2, 95% CI [1.3, 7.1].

  • Which row do you read? The equal variances assumed row, since Levene is non-significant.
  • Is the difference significant at .05? Yes, p = .006 and the CI excludes 0.
  • Write the sentence: "The groups differed, t(38) = 2.9, p = .006, mean difference 4.2 points, 95% CI [1.3, 7.1]." Add group means, SDs and an effect size.

Part 5: mini-projects to try

  1. Create a data set of 30 invented cases with age, sex, two exam scores and a yes/no pass variable. Define the variables, run frequencies and descriptives and make a histogram and a boxplot by sex.
  2. Run every test from this chapter on it, with matching syntax, and keep one .sps file that regenerates all the output.
  3. Export the output to Word with File > Export, and write one paragraph per result in the style of the projects: survey project and experiment project.
  4. Rewrite your script with DO REPEAT or a macro where two commands repeat; see macros, loops and Python.

A final checklist

Before you submit any analysis:

  • Variable Labels and Value Labels are set and the measurement levels are right.
  • Missing values are declared and counted.
  • The test matches the design, and the assumptions were checked.
  • Effect sizes and confidence intervals sit beside every p value.
  • The syntax runs from top to bottom on a fresh copy of the data.
  • Data, syntax and output files are all saved.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Same students measured twice on a scale variable: which test?

    Related measurements need a paired test.
  2. 2. What is wrong with reporting Sig. = .000 as p = 0?

    SPSS rounds to three decimals; p is tiny but never exactly zero.
  3. 3. Which command deletes unselected cases from the working file?

    SELECT IF removes the cases; FILTER and TEMPORARY keep them.
  4. 4. A binary yes/no outcome with several predictors calls for:

    Logistic regression models the odds of a 0/1 outcome.

Summary

  • Choose the test from variable types and design, then write syntax you can rerun.
  • Always check assumptions and report effect sizes with p values.
  • Spot common errors: wrong Levene row, post hoc without a significant F, p = .000, SELECT IF overwrites.
  • Build a habit of one script, one data file, one output file per project.

Next: Back to the SPSS course