Você está na página 1de 14

INTRODUCTION TO STATISTICAL RESEARCH METHODS

(829N1)
Introduction to SPSS
Based on Material prepared by Lee Stapleton
This document covers SPSS basics which you need to read and understand before the
practical exercises start in Week 5.

Data Input
Before we can begin analysing data it has to be entered into a computer software
package, here were going to use SPSS for Windows. SPSS stands for 'Statistical
Package for the Social Sciences'. This is a powerful data analysis and statistics
programme specially tailored to the requirements of social science researchers and widely
used by social researchers in universities, government agencies and the private and
voluntary sectors. SPSS is not the only computer software package available for social
researchers but it is one of the most popular. Other popular packages you may come
across are SAS, LIMDEP and Stata which are capable of some very advanced statistical
procedures which we wont be covering in this course. You can find more details about
SPSS at: http://www.spss.com/.
Of course, data does not have to be analysed with the aid of a computer. You could
analyse data manually (i.e., with the help of a calculator) by going through each set of data
individually (as was done before computers and the necessary software were available to
social scientists). However, as you will soon see, because of their computational speed,
computers when used with computer packages such as SPSS offer a much quicker way of
analysing data than manual techniques. Computer packages also enable much more
sophisticated analyses of data than most non-statistically minded people would be capable
of otherwise. The final reason why computer packages such as SPSS are widely used by
social researchers is because they usually have the capability of producing presentationquality output.
Opening SPSS
Move the mouse pointer over the Start button at the bottom left corner of the
screen, click the left mouse button once and a menu will appear above it.
Move the mouse pointer up the menu until it highlights Programs and then you
will see that automatically another menu opens to the right.
Move the mouse pointer down this menu until it highlights SPSS. This will
automatically open one further menu further still to the right. Move the mouse
pointer across to this menu and click on SPSS for Windows
SPSS will now open.
Getting started using SPSS
There are four stages to using SPSS.
1. Entering the data into SPSS.
2. Manipulating and transforming the data.
3 Testing your hypotheses
4 Analysing the results.
1

SPSS tries to reflect these distinct processes in the way the application is organised.
There are two core windows (there is also a syntax editor but you dont have to use it; it is
actually hidden by default): the Data Editor and the Viewer.
The Data Editor window is where the raw data is contained and is where you will be
entering your data. In this window you can enter new data or modify existing data.
The Viewer displays all the results of the analysis.
Starting an SPSS Session
When SPSS is started a dialog box will open asking you what you would like to do. If you
wish to enter new data, you should click the button beside Type in Data and click OK at
the bottom of the box. This box will disappear to reveal behind it the Data Editor window
(Figure 1). This is the window in which your data will be entered.
Figure 1. Data Editor Window.

You may notice that the Viewer window has not opened yet. This window does not open
until there is some output to show. Since you have not attempted to analyse any data yet
there is no output to show.
You will notice that the Data Editor has two tabs (Figure 2), Data View and Variable
View, but will default to Data View when first opened.

Figure 2. Data View


and Variable View tabs
Data View is the window in which you enter all raw data. Each case is listed vertically and
each variable is listed horizontally (see below). Variable View lists the details of your
variables vertically (see below).
Menus, Toolbar and Status Bar
Each window in SPSS contains its own menu bar with menu selections. Most of the tasks
that we will be carrying out can be performed through the menu bar.
To open the Viewer window (normally the Viewer does not open until there is some output
to display) click on the File item in the menu bar. This opens a drop-down menu.
Highlight New and another menu opens up. Move the mouse across to this menu and
highlight Output and click the mouse. A new Viewer window will open.
The Viewer window is divided into two panes (Figure 3): the left pane contains a list of the
contents in the Viewer. At the moment there will be one item displayed labelled Output.
Every time you run a procedure in order to analyse data the results will be listed in
sequence in this pane. The right pane displays the results of the procedure you have run.
This may be in the form or text, tables or charts. You can go to any part of the output by
clicking on the item in the left pane that corresponds to the output in the right pane that
you wish to view.
Figure 3. Viewer Window

Having activated the Viewer we now want to go back to the Data Editor window. In order
to do this click on the Window item in the menu bar and click on Untitled - SPSS Data
Editor. You will now be returned to the Data Editor window. An alternative (and rather
quicker way) of moving between the windows is to move the mouse pointer to the taskbar
at the very bottom of the screen and click once on the window you wish to return to.
This simple exercise illustrates three points.
1. It has demonstrated that there are two windows currently open, although only one is
usually visible.
2. It shows how you use the menu bar (e.g. by selecting items from the File menu
and the Window menu).
3. It shows that only one window is the active window at any one time (designated by
its title bar being highlighted), and that this can be changed by clicking switching
windows.
These two windows are the main ones that we shall need to use, at least for the time
being. Later, when we come to produce graphics like bar charts or pie charts, we shall
make use of one further window which is also available - the Chart Editor window - but we
can ignore this for now.
Further exploring the Menu Bar
As we saw in the exercise you have just completed, the Data Editor window contains a
menu bar consisting of ten menu items. In the exercise you have just completed, we used
two of these:
File - This allowed us to open a new window. The menu also allows us to create a new
SPSS file, or to open a file we created in a previous session. In addition, we use this menu
when we want to save or print a file, and when we want to 'exit' from SPSS.
Window - This allowed us to change the active window. The menu also tells us which
window is currently active by placing a tick by the relevant window and allows us to
minimise all the windows.
We shall soon learn about several of the others, in particular:
Transform - We use items in this menu to change our variables such as when we want to
crunch data or to create a new summary variable out of several existing ones.
Analyze - We will be making a lot of use of this! Every time we want to do some analysis
on our data, we shall do it by selecting an item from this menu. For example, we will select
Descriptive statistics + 'Frequencies' from the Analyze menu when we want a simple
frequency count. And, when we want to look at the relationship between two variables, we
will select Descriptive statistics + 'Crosstabs' from the Analyze menu.
Graphs I bet you cant guess what this ones for
Help - This menu offers guidance on all the procedures in SPSS. From this menu we can
also access the step by step Tutorial. If you ever get stuck when using SPSS and cannot
find the answer in this outline then try the tutorial.

Have a look through the different options available in the menu bar before reading on.
Note in particular that some menu items have a right-facing arrow head next to them ( > ),
and that some have dots trailing after them ( ... ). Note what happens when you click on
each type of item.
The Toolbar
The toolbar buttons (check Figure 1 on page 2 to remind yourself where the toolbar is) can
be clicked in order to start a procedure. Going through the menu bar options can also start
all of the procedures that can be started from the toolbar. However, the toolbar allows
procedures to be started more quickly because just one click on the tool is required. The
procedures that are used frequently tend to be the ones that you will find on the toolbar.
In order to find out what each of them does move the pointer so that it rests over one of
the tools. A split-second later you will see that a brief description of what the tool does
pops up just below the pointer. Some of the tools will be greyed-out because they are
inoperative. For example, the second tool in the Data Editor window when clicked saves
the data but it is greyed-out at the moment because we do not have any data in the Data
Editor to save yet.
To test the toolbar out, try placing the pointer on the extreme left tool in the Data Editor
window. Underneath the pointer will appear the description Open File. If you click the tool
then a dialog box opens which allows you to open a data file. This dialog box is exactly the
same as the one that would have been opened if you had used the menu bar, selected the
File menu and then clicked on Open.
The Status Bar
The status bar is at the bottom of the window and provides information about what is
currently happening within the window. If you look at the status bar in the Data Editor
window you will see that it says SPSS Processor is ready. In other words, this informs
you that SPSS is not occupied. When you run a procedure, such as a frequency count, the
message will change. In this example the message would read Running FREQUENCIES.
If you are running a procedure on a very large data file the SPSS processor may be
occupied for some time, and when this happens the status bar will show you how many
cases have been counted so far.
Entering Your Data in the Data Editor window
Having discussed the fundamental features of SPSS we are now ready to consider the
process of data input. Well do this by considering a hypothetical questionnaire. If you were
inputting data into SPSS, variables would correspond to different items on the
questionnaire, and for each variable there would be a set of values which corresponded to
the different respondents of the questionnaire.
Figure 4 shows the difference between variables and values. If the questionnaire
contained an item noting the sex of respondents, then this will give you one variable,
probably named 'Sex', with two responses ('male' and 'female').
SPSS works by calculating numbers; it cannot compute words. Therefore, each of the
responses must be given a number (e.g., male=1, female=2). SPSS treats the responses
that are associated with the value (e.g., male and female) as value labels.
Figure 4. Variables, Values and Value Labels
5

Variable:

Value:
Value Label:

Sex

Male

Female

To enter data into SPSS:


Make sure you are looking at the Data Editor window (Figure 5). If it is not visible then
bring it to the front of the screen by selecting it from the Windows taskbar. Now look at
the grid. It consists of columns, each of which represents a variable, and rows, each of
which represents a case (i.e., one of your respondents).
To enter data in any given cell of this grid, put the mouse pointer into the cell (the
pointer might change into a cross) and click. The cell borders become highlighted.
Then type the number that is to go into that cell. It appears in the cell editor above the
grid. Press the return (enter) key to record the value and the number is transferred to
that cell.
Figure 5. Entering Data in the Data Editor.

Entering data with the first variable from your first case (i.e. your first respondent):
highlight the cell at row 1 column 1, type the value corresponding to the first variable for
your first case, and press return.
After you press return, three things happen:
1. The number you typed appears in the designated cell.
2. The column containing that cell is given a default variable name by SPSS ('var00001').
3. The cell immediately below it in the same column is highlighted.
6

In order to complete data entry you must enter the values for all of the variables. This must
be done for all of the respondents. In this exercise, you simply have to enter some data for
several variables for illustration; well be cracking on with some real data in the first
practical session in Week 4.
There are two logical ways of entering the data and it is up to you that which you choose:
(i) If you want to enter your data one case at a time (which is probably easiest since it
means you only need to work with one questionnaire at a time), then you will need either
to click with your mouse button on the cell to the right of the one you have just filled (i.e.,
row 1 column 2), or use the arrow keys (which move the highlighted cell one place in the
direction of the arrow). You can then type the value for the second variable, enter it, and
continue in like fashion. When you have entered all the data from your first case, go back
to column 1 (see note below for how to do this) and start again with the second and
subsequent cases, each of which will be entered in a new row.
(ii) If, on the other hand, you prefer to enter data variable by variable, rather than case by
case, then after entering the data for the first cell, you will turn to your next questionnaire
and enter the value of the first variable in row 2 column 1. This cell is already highlighted,
so you do not need to select it. When you have gone through all your questionnaires
entering the first variable, you will then need to go back to the beginning (see note below
for how to do this), highlight row 2 column 2, and repeat the process for the second and
subsequent variables.
Note:
To move around in the grid, you can use the vertical and horizontal 'scroll
bars' to the right and at the bottom of the grid (see Figure 6). As in all
Windows applications, put the mouse pointer on the little square box, keep
your finger on the mouse button, and slide the little box along the bar.
Alternatively, put the pointer on one of the arrowheads at either end of the
scroll bar and hold the mouse button down while the text scrolls.
You can also use the menus to move around in the grid. If you want to go to a particular
variable, click on the Utilities menu, select 'Variables...', highlight the variable you want to
go to in the dialog box, and click on 'Go To'. If you want to go to a particular case, click on
the Data menu, select 'Go to case', type in the case number in the dialog box, and click
on OK.
When you have entered the data from all your questionnaires, you will end up with a
completed grid with variables along the top and cases down the side. At this stage, the
variables will all have the default names given them by SPSS (var00001, var00002, etc.).
Dont worry about this at the moment - we shall give our data proper variable names in a
later section.
Saving the data
It is crucial that you save the newly entered data in your personalised drive before you exit
SPSS otherwise your work will be lost. Even if you do not intend to exit SPSS it is good
practice to save the data file every so often just in case the computer locks-up or SPSS
terminates due to an error. It is also strongly advised that you back up your raw data. To
save data in SPSS:
Ensuring that the Data Editor window is the window you are currently working in, click
on the File menu item at the top of the screen and select 'Save As...'. This opens a
dialog box requiring you to give information regarding:
(i) the disk drive to which the file should be saved
(ii)the type of file it is
7

(iii)
the file name under which it should be saved.
Selecting the drive: by default, SPSS designates a folder within the hard disk,
presumably your personalised drive. To choose an alternative to the default selection,
click on the downward pointing arrow to open the Save in menu, scroll through the
options and click on the desired alternative.
The file type: with the dialog box still open you need to check the type of file you are
going to save. Here the default option in the Save as type box is sav and is the one
you want. In SPSS, files containing data are called save files and are always
designated by the .sav suffix. You therefore need do nothing to change this.
Now click on the Save button. The file will be saved to your designated drive, and you
will be returned to the Data Editor window. Note that the title bar has now changed from
'Untitled' to the name you have given this file.

Customising Data
You will have started to generate a data file representing the hypothetical data you have
entered from the questionnaires. The first task to customise this file is by defining variable
names and value labels.
Defining variable names
SPSS creates default names for each variable ('var00001' etc.), and you may decide to
retain these, but can be somewhat confusing on your eventual output. If you wish, then,
you can create new variable names. Variable names must begin with a letter of the
alphabet, must not contain blanks, and must not contain question marks (?), exclamation
marks (!), apostrophes (') or asterisks (*). Obviously, every variable name must be
different. It is up to you how you want to name the variables. You may want to give them
names like 'sex', 'age', or 'smoker', or you may prefer simply to name them by the
questionnaire question numbers to which they refer (e.g., 'q1', 'q2a' 'q2b').
Remember that in the Data View of the Data Editor, each column of data refers to one
variable. At the moment, these have SPSS default names ('var00001' etc.). To change
these:
Double-click on a variable name at the head of any column in the Data View window.
This opens the Variable View (see Figure 6). (Note that another way of accessing this
window is via the Variable View tab at the bottom of the screen)
In the Variable View window, variables with default SPSS variable names are viewed in
rows, with each column representing the attributes of the variable.
To change the name of the variable click on the cell containing the name that you want
to change and simply type in the new name.
If you now return to the Data View window, you will see that the SPSS default variable
name has been replaced with the name you have just typed in.
Variable View allows you to do much more than simply name the variables. For example,
you can also now give your variable a descriptive label, you can give the values of the
variable a label and you can specify the scale of measurement of the variable.
Figure 6. Data Editor Variable View

Specifying variable labels and value labels


9

The purpose of specifying labels is to make it easier for you to recognise each variable
and to inform you what the values stand for. You may not always need to give every
variable a descriptive label. A variable named 'age', for example, is probably selfexplanatory and needs no further elaboration. Variable labels are useful in cases where
the variable name is not fully self-explanatory, and they will be essential if you are working
with SPSS default variable names, or if you have named your variables by question
numbers (q1, q2a, etc.). Adding variable labels means that you will know what you are
looking at when you go on to produce tables of output. Variable labels can include blanks,
but long labels will not be fully printed out on output, so it is a good idea to limit them to a
maximum of about 30 characters. The labels you specify will appear at the head of all the
tables of output you produce.

To add a variable label, click in the cell that corresponds to the variable you want to
describe, in the label column, and type your description (Figure 6)

Labelling the different values of each variable can also be useful. For example, if 'male'
was coded '1' and 'female' was '2', it's not very helpful to get output telling you how many
respondents were '1' and how many were '2'. It is far better to have meaningful labels
saying how many were male and how many were female.
To add value labels, click in the cell that corresponds to the variable to which you want
to add values, which not only highlights the cell, and provides a tool button in the cell
itself (Figure 7)

Figure 7. Value Cell and Tool Button

When you click the grey square icon in the cell, it opens the Value Label dialogue box
(Figure 8)
To assign labels to the different values of this variable, type the value number in the
'Value' text box, type its corresponding label in the 'Value Label' text box, then click on
the 'Add' button. It then appears in the box at the bottom. Repeat for each value, and
when you have finished click OK.
Figure 8. Defining Value Labels

10

Scales of Measurement
To select the scale of measurement of the variable click in the cell which applies and a
menu icon appears. Clicking on the menu icon presents you with a choice of three
levels of measurement (Figure 9). Highlight and click the desired level of measurement.

Figure 9. Variable scales of Measurement


* nominal (or categorical) measures are at the lowest level for they use numbers simply
as names or labels for different values (e.g., Female=1 Male=2);
* ordinal measures are like nominal ones in that they too use numbers simply as labels,
but in this case a higher number does indicate more and a lower number less (e.g., How
often do you smoke? Never=1, Sometimes=2, Frequently=3, Very often=4)
* interval (scale) measures use numbers to represent a scale in which the intervals
between each value on the scale are the same (e.g., Which income band do you think you
belong to? Bottom third=1, Middle third=2, Top third=3). Interval measures also cover
variables for which there exists an arbitrary zero reference point e.g. temperature
measured in Celsius or Fahrenheit are interval variables because 0 C or 0 F does not
mean no temperature.
* ratio (scale) measures are the highest level of measurement, for here numbers form part
of a scale with equal intervals and a non-arbitrary zero reference point e.g. peoples ages
in years or their income in pounds. Note that 0 years and 0 income mean no years and
no income respectively i.e. the zero reference point is non-arbitrary.

SPSS Output
Exploring the Viewer Window
When we run an SPSS procedure, the results are sent to the Viewer window. This output
can be saved to a particular file name (in exactly the same way as you saved the contents
of the Data Editor window to your storage device earlier), and it can be printed.
The important point to remember about the Viewer window is that all of your output during
a session is sent there. Every time you run a job, the output gets tacked onto the end of all
the other output from all the other jobs you have run. The output is displayed in the pane
on the right (see Figure 10). In the pane on the left a list of procedures that you have run is
shown. You can click on the relevant icon in the left pane to different parts of the output in
the right pane. A small arrow beside the icon indicates that the corresponding output is
currently being displayed in the right pane. Alternatively, you can scroll up or down to the
output in the right pane by using the scroll bars to move to different parts of the output.
Figure 10. Exploring Output in SPSS Viewer
11

Printing from the Viewer


It is unlikely that you will want to print all of the output at once. Instead, you are more likely
to want to print specific parts of the output. In order to do this:
Click on the icon in the left pane which corresponds to the output you wish to print
(alternatively, you can click on the output in the right pane). If you want to print all of the
output for the particular procedure, then click on the yellow icon. If you want to print only
part of it, click on the icon which corresponds to the part of the procedure you wish to
print.
Click on File in the menu bar and then Print... in the drop-down menu. A dialog box will
open, check that under Print range the button beside Selection has been chosen (this
is to ensure that only the selected output is printed), and click OK.
Copying Output to Word for Windows
In order to copy an output item from the viewer to Word:
Click on the item (e.g., table, Chart, etc.) that you wish to copy.
Go to Edit on the menu bar, and click on Copy.
Open Word.
Go to Edit on the menu bar and click on paste special (not paste).
A dialog box will open, click on picture and then OK.
Managing Output
During an SPSS session you may create a great deal of output. This can cause two
problems. The first problem is that when it comes to saving or printing the output you will
probably want to keep or print only a small proportion of it. The second problem is that you
may find it difficult to find the relevant output simply because there is so much of it.
The problem of separating output that you may want to save or print from output that you
are unlikely to want to do anything with can be dealt with by opening a new window called
Draft Viewer. As the name suggests, it displays all of the output in draft form and is not of
presentation quality. When you are experimenting with the data you can send all of your
12

output to the Draft Viewer (see Figure 11) and when you run a procedure where you think
you are likely to want to save or print its output then you can send it to the Viewer.
To open the Draft Viewer:
Click on File (in either the Data Editor or Viewer window), move the mouse down to
New in the drop-down menu and click on Draft Output.
Figure 11. The Draft Viewer

It is important to understand that simply opening a new output window does not guarantee
that your next job results will be sent there. SPSS always sends result to the designated
output window, and until you tell it otherwise, it assumes that this is the original one
which was opened when you began your analysis. In order to designate a viewer window
as the active window to which output goes:
Go to the viewer window which you want to make the active window and click on the
icon with ! (+, a green cross in version 14) on it in the tool bar. Check that it is the
designated window by looking for the red ! along the status bar (+, a green cross in
version 14 on the icon programme). Now all of the output will go to this window only
until you designate a different viewer window.
Dealing with the problem of large quantities of output can be achieved by opening different
Viewer windows for different parts of the data analysis. For example, you could open a
different Viewer window for each new hypothesis that you set out to test. This groups the
output together in a coherent way and reduces the amount of output in the Viewer window.
Therefore, searching for output should become much easier.
To open a new Viewer window:
Click on File (in either the Data Editor or Viewer window), move the mouse down to
New in the drop-down menu and click on Output. There is no limit to the number of
output windows you can open.
Just as is the case with the Draft Viewer, in order to send output to the newly opened
Viewer window you must designate it as the output window by clicking on the icon in the
toolbar with ! on it. Only one Viewer window can be the output window at any one time.
However, you choose between the different Viewer windows you wish to have the output
sent to by means of clicking on the ! icon in the Viewer you want to be the output window.

13

The Viewer Window: Opening, Closing and Saving


Note: You can also open a Viewer window to look at or edit an existing output file that was
created and saved in a previous session. To do this, you would need to highlight 'Open'
rather than 'New' from the File menu.
If you want to close an output window, you do it in exactly the same way as in any other
Windows application - i.e., click on the button in the top right corner. You cannot, however,
close your designated output window.
The other important point to bear in mind is that your results are not automatically saved.
When you run an SPSS job, you should always first look through the results on screen in
the designated output window. If you then feel that you want to save these results, you
need to do this by saving the contents of the window as a new file.
To save the contents of an output window, go to the File menu and select 'Save as...'.
This will then open a dialog box that will ask you the name of the file you want to create, as
well as the drive to which it should be sent.
A file that contains the results of a job is called an output file. As with all file names, the
name you give to your output file is limited to 32 characters, followed by a full stop,
followed by a 3 character suffix which tells you (and SPSS) what kind of file it is. The
convention in SPSS is that output files should have the suffix '.spo'. This distinguishes
them from data files which, as we have seen, have the suffix '.sav'.

14

Você também pode gostar