Data Handling in SPSS
overview
Objective:
•To introduce key data handling techniques in SPSS, including dataset creation, importing
data, defining variable attributes, understanding measurement levels, and creating new
variables.
Topics Covered:
•Creating an SPSS Dataset
•Reading Data from Different Formats
•Defining Variable Attributes
•Levels of Measurement
•Creating New Variables
Creating an SPSS Dataset
• Creating an SPSS Dataset
• Steps to Create a Dataset:
• Open SPSS software.
• Select File > New > Data.
• Enter data directly in the Data View tab.
• Key Tabs in SPSS:
• Data View: For entering raw data.
• Variable View: For defining variable names, types, and other attributes.
Reading the dataset from different
formats
• Supported File Formats:
• Excel (.xls, .xlsx)
• CSV (.csv)
• Text Files (.txt, .dat)
• Database files (such as Access)
• Other statistical software formats (e.g., SAS, Stata)
• How to Import Data:
• File > Open > Data
• Select the file format and navigate to the data file location.
• Follow the import wizard to configure data if necessary.
Defining Variable Attributes
Important Attributes in SPSS:
• Variable Name: Unique identifier for each variable.
• Type: Numeric, String, Date, etc.
• Width: Defines character length for string variables.
• Decimals: Number of decimal places for numeric variables.
• Label: Descriptive label for the variable.
• Values: Coded responses (e.g., 1 = Male, 2 = Female).
• Missing Values: Specify codes for missing data.
Different Levels of Measurement
• Understanding Levels of Measure:
• Nominal: Categories without order (e.g., Gender, Marital Status).
• Ordinal: Categories with a meaningful order but unequal intervals (e.g.,
Satisfaction Rating).
• Scale (Interval/Ratio): Continuous data with equal intervals (e.g., Age,
Income).
• Assigning Levels in SPSS:
• Define in the Measure column in Variable View.
Creating New Variables
Ways to Create New Variables in SPSS:
•Compute Variable: Create variables based on calculations (e.g., summing scores).
•Recode into Same/Different Variable: Useful for grouping data or recoding responses.
•Steps for Compute Variable:
•Select Transform > Compute Variable.
•Enter the new variable name and specify the formula or calculation.
•Steps for Recode Variable:
•Select Transform > Recode into Different Variables.
•Specify the variable, recode values, and define new values.
Practical Exercise
• Practice Task:
• Create a dataset in SPSS with sample data.
• Import an external file (e.g., CSV) into SPSS.
• Define variable attributes and assign measurement levels.
• Create a new variable using the Compute function.