Professional Documents
Culture Documents
Chapter+2+Importing+Data+in+SPSS 1.0
Chapter+2+Importing+Data+in+SPSS 1.0
© Sanjay Singh
2
'The road to every heaven goes through a hell. Bear this in mind."
- Swami Vivekanand, Complete Works
Sanjay Singh
© Sanjay Singh.
Email: sanjay.singh3210@)gmail.com
Images and screenshots of IBM SPSS Statistics software is used in this book for
only learning purposes. The source/credit of any other illustration, image or
resource is duly acknowledged wherever applicable. This book is "work in
progress" and I will keep it continuously updated. Please do not feel offended if
you find typos or errors anywhere and kindly do not rush for an assessment of
IQ & EQ of the author based on some unintentional mistakes that he as a mortal
may commit. I am yet to organize content for many chapters and proof reading
the book is a distant dream. This book is like an experimental release, and it will
take time to give it a final shape. . Kindly behave and do not redistribute content
in unauthorized manner. Any positive comment and suggestion to improve book
is welcome.
Research involves working with data that we in different file types. IBM SPSS Statistics is a
powerful software package level of handling multiple types of files. No matter if you are a social
researcher comfortable with Excel files or analytics or designs professional working with
advanced database files, SPSS offers a straightforward and intuitive interface to import various
types of data files. The following, we will see the available file import options and how to work
with them.
If you want to import any file in SPSS, go to File > Open > Data {Figure 1 (a)}.
Alternatively, you can directly click the (folder) icon, which directly opens the location of
your data file {Figure 1 (b)}.
© Sanjay Singh
Figure 3 : File formats available in SPSS
4
1.SPSS Statistics (.sav) - Standard (commonly used) file extension type in SPSS.
2. SPSS Statistics Compressed (.zsav)- The format that leads to the SPSS statistics compressed
file type. It is a compressed file format of the standard extension type. Whenever we are working
with the large data set, and we have to save disk space, we would want to compress our data set
file. Softwares like WinZip or WinRar help us to compress a large file into a smaller
one. This file format .zsav, can be used to open the compressed file formats in the SPSS.
3. SPSS/PC+ (*.sys) - The extension of this file format is .sys file format. This file format is not
commonly used these days. A person is most likely to use this file format if she is working with
the DOS operating system or Disk Operating Systems. These file formats used to be compatible
with the old IBM PCs, which are no longer in work today. Nevertheless, IBM has maintained
some of the file formats which are not very commonly used these days.
4. Portable (.por) - It stands for portable file formats. It is an important file format that you can
use when you want to share your data files across various types of operating systems and various
versions of SPSS. por ensures that your file gets easily opened if somebody is using an older
version of IBM SPSS (say version 15 or 9) or if somebody is using an operating system different
than yours.
5. Excel (*xls, *xlsx, *xlsxm) - .xls refers to the excel file format. It is the most popular file
format, other than the SPSS standard .sav, with which we work in SPSS. Most researchers
collect data in Microsoft Excel or another spreadsheet program and then import data in SPSS for
analysis.
6. Lotus file format (*.w*) - Lotus was one of the spreadsheet programs by IBM, and it was one
of IBM's most popular programs. If you have your data into Lotus's spreadsheet format, you can
use this extension type to open the Lotus file.
7. Sylk (*.slk) - Sylk stands for the symbolic link format. It is a Microsoft file format used to
exchange data between spreadsheets. Sylk and Lotus are not very common with analysts these
days. Excel is more popular as compared to these two spreadsheet programs.
8. dBase (*.dbf) - The extension of this file format is .dbf. It is used for opening old database
management files based on microprocessors. dBase was one of the first database management
system for microcomputers, and it was very popular in olden times, but not today. We can again
club it into the old database categories which are not very popular these days but are available in
SPSS.
© Sanjay Singh
5
9. SAS file format (*sas7bdat, *.sd7, *.sd2, *.ssd01, *.ssd04, *.xpt) - It clubs various SAS file
types. SAS is a very popular and important analytics program. It is used for doing data analysis
and modeling. You can open the SAS files in SPSS by selecting this file format.
10. Stata (*.dta) – Stata is another software program for data analysis we see more popular with
economists. You can open the Stata files in SPSS, which has a .dta extension. Though SYSTAT
is not listed here, you can also open SYSTAT files, which is another software program for doing
quantitative analysis.
11. Text file formats (*.txt, *.dat, *.csv, *.tab) - There are various kind of textual or text file
formats, with extensions like .txt, .dat, .csv, .tab. We have a fairly good amount of experience
with working textual files.
.txt is a useful file format used with text-based programs like MS Notepad or MS Word
pad
.dat is another text-based file format.
If you compare the file formats - .txt, .dat, .csv, .tab - these have been defined according
to the kind of delimiters or separators that they use for separating the values. .txt is
generally the raw file format, while for the .dat extension, the values are delimited or
separated by a tab.
.csv is another popular file format. You can directly create .csv files from the MS Excel.
Other software packages like SmartPLS typically work with the .csv file format.
.tab extension is another kind of text-based file format in which the delimiter is the tab.
In the following, we will learn how to open these various types of file formats in SPSS.
Excel is one of the most popular file types for working with SPSS. Often, as a researcher, we
collect our data in MS Excel or other Excel spreadsheets and we try to import that data in SPSS.
An excel data file looks as follows (Figure 3):
© Sanjay Singh
6
Now, we will open a sample Excel dataset, ‘survey_sample’ . The data set contains three excel
sheets, 'survey_sample' data, 'smokers' data, and 'poll' data .
The three different types of data set have been combined for demonstration purposes. When you
collect your data, you might save your data in various spreadsheets and you can import that data
either from different spreadsheets (like we have 3 sheets here) or from a single sheet.
© Sanjay Singh
7
You may not see any excel file in the dialog box, even if there is an excel file. This occurs
because the default file of type is SPSS Statistics (.sav). You need to change the file type from .sav
( ) to Excel ( ) from the dropdown list of
file Type to see the Excel data stored there.
© Sanjay Singh
8
You will notice that SPSS prompts you to select the worksheet you want to import from the
chosen Excel file. When you open the Worksheet drop-down list, you will see the sheet names
available in the Excel file selected. In the current database, there are three worksheets,
‘survey_sample,’ ‘smokers,’ and ‘poll data.’ Currently, we want to import only ‘survey_sample’
data. Choose only ‘survey_sample’ data (Figure 7).
© Sanjay Singh
9
Challenge: Suppose we do not want to import the entire worksheet and instead want to
import only the first ten rows of the data. How will you accomplish it?
Solution: Click the Folder icon, locate the file and select the file type as Excel and click Open. In
this case, the complete survey data consists from rows A1 to D17. To import the data only for the
first ten observations from rows A to D, define the range from ‘A1: D11’. You would wonder,
why D11 and not up till D10? Because the first row is only a descriptor of your variable and we
require data of the first ten individuals. So, that is why we take D11. Click OK. So, that's how you
can import your entire excel sheet or just import a selective part of it (Figure 9).
© Sanjay Singh
10
Let us learn how to import a CSV file formatting in SPSS. CSV file format stands for comma-
separated values, and these are important file formats with which often work in the SPSS. Apart
from this, if you are working with some specialized software programs like SmartPLS, which is
used for the partial least square structural equation modeling (PLS-SEM), you generally use the
CSV file format. We will use a CSV file for demonstration purpose, i.e., bankloan.csv which
come inbuilt with SPSS. I have created the CSV file by using the sample data set in the SPSS.
© Sanjay Singh
11
Step 1
1. Does your text file
match a predefined format? We
are not using any predefined
format. Click No > Next. If you
1
select any predefined format, so
you have to first Browse and
identify your file format type.
© Sanjay Singh
12
Step 2
4. What are the decimal symbols? Decimal symbols are , in our case. If it is Comma, you
can select Comma and you can see the preview of your data in the dialog box below this
question. Click .
© Sanjay Singh
13
Step 3
Step 4
© Sanjay Singh
14
© Sanjay Singh
15
in doubt while working with SPSS, I will suggest choosing the default options in most of the
cases. Further, click on .
Step 6
© Sanjay Singh
16
The CSV data has been imported into SPSS. If you select another kind of file format, like Tab-
delimited or some other space-limited file type of format, in that case, the procedure is the same.
You have utilized the Text Import wizard.
© Sanjay Singh