Assignment 2: Data Handling in SPSS

(PSY206) Data Management and Analysis

Author

Md. Rasel Biswas

Introduction

In psychological research, preparing and transforming data is a crucial skill. This assignment will help you practice SPSS data handling techniques, including data entry, recoding, computing variables, selecting cases, and obtaining descriptive statistics.


1. Working With Patient Health Data

You are given information on 15 hospital patients attending routine check-ups.
The dataset includes the following variables:

  • patient_id
  • sbp — systolic blood pressure
  • age_years
  • sex (M = Male, F = Female)
  • school_years — years of schooling completed
  • monthly_income
  • residence_area (U = Urban, R = Rural, SU = Semi-Urban)

1(a) Data Entry

Enter the following dataset into a new Excel sheet exactly as shown:

patient_id sbp age_years gender school_years monthly_income residence_area
1 130 25 M 4 3000 U
2 140 48 F 6 5000 R
3 160 50 M 8 5000 SU
4 160 47 M 12 6500 R
5 141 30 F 10 6000 R
6 144 37 M 11 6000 SU
7 155 26 F 8 6300 R
8 129 22 M 3 2500 U
9 164 51 F 5 2500 R
10 124 16 F 5 2400 SU
11 125 29 F 10 4500 U
12 136 32 M 12 8000 U
13 125 25 F 12 7500 R
14 126 28 M 14 14000 R
15 165 55 M 14 16000 SU
  • Save the file as patient_data.xlsx
  • Import the Excel file (patient_data.xlsx) into SPSS using:
    File → Import Data → Excel

1(b) Creating a Reduced Dataset

Create a new dataset containing only:

  • patient_id
  • sbp
  • sex
  • monthly_income

Save it as:

E:\patient_subset.sav

2. Working With world95.sav

Open the dataset world95.sav, which contains demographic and health information for a sample of countries. Keep all existing variable names exactly as they appear.

Create new variables using the improved names listed below.

2(a) Compute average life expectancy

Create a new variable called:

lifeexp_avg

which represents the mean of lifeexpm and `lifeexpf.


2(b) Recode infant mortality into groups

Recode the variable babymort into a new variable named:

babymort_group

Use the following categories:

  • 0 to 50 → 1
  • 50 to 100 → 2
  • 100 to 150 → 3
  • 150 to 200 → 4

2(c) Create a trimmed infant mortality variable

Create a new variable named: babymort_trimmed

Rules:

  • If babymort > 150 → assign system missing
  • Otherwise → keep the original babymort value

2(d) Select a filtered dataset

Select only countries where:

  • religion = Muslim
  • literacy > 50

Save this filtered file as:

E:\muslim_literate.sav

2(e) Draw a random sample

Draw a simple random sample of 17 countries from the dataset.

Save the resulting file as:

E:\country_sample17.sav

2(f) Frequency distribution

Obtain a frequency table for the variable: region


2(g) Descriptive statistics for life expectancy

Compute the following for:

  • lifeexpf
  • lifeexpm

Required statistics:

  • Mean
  • Median
  • Standard deviation
  • Minimum
  • Maximum

2(h) Create a copy of the calorie variable

Create a new variable: calorie_copy which simply duplicates the existing variable calorie.

Then compute summary statistics (mean, SD, min, max) for calorie_copy.


Submission

Submit:

  • The syntax file (.sps)
  • THe output file (.spv)
  • All generated data (.sav) files