SPSS for Biostatistics and Health Data Analysis
IBM SPSS Statistics is a menu-driven and syntax-capable program used to manage, analyse and present clinical, epidemiological and public-health data. Correct variable definition, data cleaning and interpretation are more important than simply clicking statistical commands.
Learning objectives
- Describe the SPSS interface and file structure.
- Define variables and enter or import health data correctly.
- Clean and transform data using reproducible procedures.
- Perform descriptive and basic inferential analyses.
- Interpret SPSS output and report results appropriately.
The SPSS working environment
Data View
Rows represent cases or participants and columns represent variables. Cells contain the observed values.
Variable View
Defines name, type, width, decimals, label, value labels, missing values, column display, alignment and measurement level.
Output Viewer
Displays tables, charts, warnings and analysis results. Save it separately as an output file.
Syntax Editor
Stores commands so analyses can be checked, repeated and audited.
Defining variables correctly
| Property | Purpose | Example |
|---|---|---|
| Name | Short unique identifier without spaces | sys_bp |
| Type | Numeric, string, date or other format | Numeric |
| Label | Clear description | Systolic blood pressure (mmHg) |
| Values | Meaning of coded categories | 0 = No, 1 = Yes |
| Missing | User-defined missing codes | 99 = Not recorded |
| Measure | Nominal, ordinal or scale | Scale for age |
Use a unique study identifier and remove unnecessary direct identifiers. Keep a data dictionary and preserve an unchanged raw-data file.
Importing and checking data
- Use File → Open → Data or import an Excel/CSV file.
- Confirm that the first row contains variable names.
- Check variable types, labels and missing-value definitions.
- Run Frequencies for categorical variables and Descriptives or Explore for numerical variables.
- Inspect minimums, maximums, distributions, missingness and impossible values.
- Save a cleaned working copy with a new version name.
Common data-management procedures
- Transform → Compute Variable: create BMI, totals or other derived variables.
- Transform → Recode: group age or change category codes; prefer recoding into a different variable.
- Data → Select Cases: analyse a defined subset without deleting records.
- Data → Sort Cases: arrange cases by one or more variables.
- Data → Merge Files: add cases or variables after checking unique identifiers.
Descriptive statistics
| Question | SPSS route | Typical output |
|---|---|---|
| How common is each category? | Analyze → Descriptive Statistics → Frequencies | Counts and percentages |
| What is the centre and spread? | Analyze → Descriptive Statistics → Explore | Mean, median, SD, IQR and plots |
| How do two categories relate? | Analyze → Descriptive Statistics → Crosstabs | Row/column percentages and chi-square |
| What is the data distribution? | Graphs → Chart Builder | Histogram, box plot or bar chart |
Choosing inferential procedures
- Independent-samples t-test: compare the means of two independent groups.
- Paired-samples t-test: compare two related measurements.
- One-way ANOVA: compare means across three or more independent groups.
- Chi-square test: assess association between categorical variables.
- Correlation: measure the direction and strength of association between numerical variables.
- Linear regression: model a continuous outcome.
- Binary logistic regression: model a binary outcome and report odds ratios.
- Non-parametric tests: use appropriate rank-based methods when their conditions fit the question and data.
Worked interpretation
Suppose an independent t-test comparing mean haemoglobin between two groups gives a mean difference of 1.2 g/dL, 95% CI 0.4–2.0 and p = 0.004. Because p < 0.05 and the interval excludes 0, the groups differ statistically. The estimated difference is 1.2 g/dL; clinical relevance must be judged using context, study quality and potential bias.
Chi-square output
Check expected cell counts before interpreting Pearson’s chi-square. Report χ², degrees of freedom, p-value and relevant percentages.
Regression output
Report coefficients or odds ratios with 95% confidence intervals and p-values, while assessing assumptions, confounding and model fit.
Using syntax for reproducibility
FREQUENCIES VARIABLES=sex outcome. DESCRIPTIVES VARIABLES=age systolic_bp /STATISTICS=MEAN STDDEV MIN MAX. CROSSTABS /TABLES=exposure BY outcome /STATISTICS=CHISQ RISK /CELLS=COUNT ROW. T-TEST GROUPS=treatment(0 1) /VARIABLES=systolic_bp /CRITERIA=CI(.95).
Use the Paste button in dialogue boxes to send commands to the Syntax Editor before running them. Add comments, keep a dated syntax file and save the output so the analysis can be reproduced.
Assumptions and quality checks
- Match the test to the study design and variable measurement level.
- Check independence, distributional assumptions, outliers and variance requirements.
- Verify coding and reference categories before modelling.
- Distinguish user-missing codes from genuine numerical values.
- Do not repeatedly test variables until a significant p-value appears.
- Report effect sizes and confidence intervals, not p-values alone.
Review questions
- Differentiate Data View from Variable View.
- Which SPSS procedure assesses association between two categorical variables?
- Why should recoding usually create a new variable?
- How would you report a logistic-regression odds ratio?
- Why is syntax important for research quality?
Return to the Clinical Medicine Year 2 curriculum
References
- IBM Documentation. SPSS Statistics.
- World Health Organization. Basic Epidemiology.
- CDC. Principles of Epidemiology in Public Health Practice.
Educational content only. Analysis of identifiable patient information must follow ethical approval, data-protection law and institutional policy.
