2.2 Data Import
(PSY206) Data Management and Analysis
Importing Excel Data Files into SPSS
- Suppose we have an Excel file
vote.xlsx
(download) containing data like the following:
Steps to Import an Excel File
- Open SPSS and go to
File > Open > Data
.
- A new window will appear asking you to select the File Type.
- Choose Excel (.xls, .xlsx) from the drop-down menu.
- Browse to the folder where the file is saved and select your file.
- Click Open.
- A new window will appear as shown below:
Selecting Data from the File
- In the import dialog box:
- Select the appropriate worksheet (if the Excel file has multiple sheets).
- By default, SPSS imports the entire sheet.
- To import only a portion of the data, specify a Range (e.g.,
A1:B6
).
- Select the appropriate worksheet (if the Excel file has multiple sheets).
Example: To import only the variables ID and Gender from the first 6 rows, enter A1:B6
in the Range field.
Practice
- Try importing the following files:
hs0.sav
(download)
hs0.xls
(download)
Reflection Question
- What are the advantages of importing a
.sav
file instead of an Excel file?
(Hint: Consider variable names, labels, formats, and missing value handling.)
Importing Other Software Data (Stata, SAS, etc.)
- Besides Excel, SPSS can directly open datasets created in other statistical software such as:
- Stata (
.dta
)
- SAS (
.sas7bdat
)
- SPSS portable files (
.por
)
- Stata (
This feature is useful when collaborating with researchers who use different software.
General Steps
- Go to
File > Open > Data
.
- From the File Type drop-down list, choose the relevant format (e.g., Stata, SAS).
- Browse to the folder where the dataset is saved.
- Select the file and click Open.
- The dataset will appear in SPSS with variable names, labels, and some metadata preserved.
Practice
- Try importing a dataset from another software, e.g.,
bdhs2014.dta
(download) from Stata orairline.sas7bdat
(download) from SAS.
Summary
- Excel files: Good for raw data entry and sharing, but limited in metadata.
- Stata / SAS files: Retain more metadata and are useful for collaboration.
- SPSS (.sav): Native format with full compatibility (best for long-term work).