You are on page 1of 13

SPSS tutorial

Objectives: After completing this tutorial you will have a basic familiarity with SPSS.
This familiarity will include skills related to: opening and creating files, inputting data,
frequency tables with raw scores and intervals, histograms, box-and-whisker plots, stem-
and-leaf plots, and descriptive statistics.

Getting started
SPSS is present on all university computers. In addition you can download a copy and
install it on one personal computer. To install on your personal computer go to MyASU,
select MyApps website and download a copy of SPSS 27.

Once the program is installed or if you’re at a computer lab you can start the
PASW/SPSS by going to [Start => All Programs => IBM SPSS Statistics] menu and
start the package by clicking on the SPSS icon.

Starting the program will result in the following menu. Click the “type in data” bubble
then “O.K.” this results in an Excel like spreadsheet.

Creating and opening files

Entering data into SPSS is very similar to how it is done in Excel, with each column
representing a variable, start at the leftmost column and begin entering the following
data. See screenshot below for an example of how it will look in SPSS.
 
County # of Deaths County # of Deaths
County # of Deaths
Harding 0.00 Roosevelt 2.00
Bernalillo 54.00 Hidalgo 3.00 Sandoval 16.00
Catron 3.00 Lea 11.00 San Juan 37.00
Chaves 4.00 Lincoln 3.00 San
Cibola 12.00 Los Miguel 8.00
Colfax 10.00 Alamos 1.00 Santa Fe 16.00
Curry 6.00 Luna 10.00 Sierra 6.00
De 3.00 McKinley 34.00 Socorro 11.00
Doña 26.00 Mora 4.00 Taos 5.00
Eddy 14.00 Otero 13.00 Torrance 8.00
Grant 5.00 Quay 7.00 Union 4.00
Guadalupe 4.00 Rio Valencia 14.00
Arriba 13.00  
 

Notice at the top of the column the variables are labeled VAR0001 and VAR0002. You
will want to rename them as “county” and “deaths”. To do this, double click on
VAR0001 or VAR0002. You will get a variable view screen that looks like the one
below. Now you can click on VAR0001 and VAR0002 and rename them “county” and
“deaths”.

Click here to change variable name. Notice that the “type” column has VAR0001 labeled
as a string variable and VAR00002 labeled as a numeric variable. This is due to the
county variable being comprised of letters and the deaths variable being comprised of
numbers. Also, notice the level of measurement for the “county” variable is labeled as
nominal and “deaths” is labeled scale. If you ever need to change these values simply
double click on the cell of interest and make the necessary changes.

After renaming the two variables to “death” and “county” you will want to go back to the
data editor, to do this click on the data view tab at the bottom of your screen.

Now complete entering the data from the table above. When you are finished save it to
your desktop or thumb drive by clicking file > save as. Shown below.

This will result in screen that is similar to other windows-based programs. Name the file
“nmdeath” and make sure the “save as type” field ends with “sav”. Make sure you save
this file.

Opening Files

Oftentimes, you will be sent a data file by a client/colleague for your analyses. At times,
these files will be sent to you in non-SPSS formats. Fortunately, SPSS can handle several
common formats (Excel, DBF, CSV, etc.).

In Canvas find the data file titled tutorial1.sav. Click on the file for tutorial1.sav using the
right button on your mouse (i.e., right click).

Click on “save target as” and save the file to your desktop. Once you have the file on
your desktop open it by double clicking on it. SPSS will open and you will see a
spreadsheet that looks like this. You might need to close the output and syntax windows.
If so, click on the X box in the top corner of each window.
Frequency Tables

As we discussed on class it is often difficult to identify patterns in our data when looking
at raw scores. For example, look at the column labeled zoo and try to identify a pattern in
the raw scores. It’s very difficult. One way to look at our data that addresses this problem
is to create frequency tables. To create a frequency table click on analyze > descriptive
statistics > frequencies which results in the following view.

After you click on frequencies you will see the menu below. Notice that the zoo variable
has been added to the right side. Left clicking on zoo and then pressing the right facing
arrow in the center of the menu did this.
Now click the OK button. The output screen will popup and you will see the table below.
Unfortunately, the table is not very useful, because the values on the measure are
continuous. In other words, the frequency table is not much better than the raw values. It
would be useful to split the data into quartile intervals.

zoo story

Cumulativ e
Frequency Percent Valid Percent Percent
Valid .5 1 1.3 1.3 1.3
1.5 3 3.9 3.9 5.3
2.0 3 3.9 3.9 9.2
2.5 3 3.9 3.9 13.2
3.0 1 1.3 1.3 14.5
3.5 4 5.3 5.3 19.7
4.0 4 5.3 5.3 25.0
4.5 3 3.9 3.9 28.9
5.0 2 2.6 2.6 31.6
5.5 1 1.3 1.3 32.9
6.0 4 5.3 5.3 38.2
6.5 2 2.6 2.6 40.8
7.0 3 3.9 3.9 44.7
7.5 4 5.3 5.3 50.0
8.0 3 3.9 3.9 53.9
8.5 1 1.3 1.3 55.3
9.0 3 3.9 3.9 59.2
9.5 2 2.6 2.6 61.8
10.0 3 3.9 3.9 65.8
10.5 1 1.3 1.3 67.1
11.0 2 2.6 2.6 69.7
11.5 1 1.3 1.3 71.1
12.5 1 1.3 1.3 72.4
13.0 5 6.6 6.6 78.9
13.5 2 2.6 2.6 81.6
14.0 3 3.9 3.9 85.5
14.5 1 1.3 1.3 86.8
15.5 2 2.6 2.6 89.5
16.0 1 1.3 1.3 90.8
16.5 2 2.6 2.6 93.4
19.5 1 1.3 1.3 94.7
20.0 1 1.3 1.3 96.1
20.5 1 1.3 1.3 97.4
21.0 1 1.3 1.3 98.7
23.5 1 1.3 1.3 100.0
Total 76 100.0 100.0

Splitting a variable into intervals.

Select transform > Visual Binning (used to be Bander).


This results in the menu below. Place zoo in the “variables to band” column as you did
with frequencies.

Clicking continue results in the following menu.

Click “zoo story” to get this histogram, and click on “make cutpoints” to arrive at the
following menu.
自己操作:
We want to create quartiles so click on the bubble labeled “equal percentiles based on
scanned cases”. To do this we need to make cutpoints at the 25th, 50th, and 75th
percentiles. This is why I entered “3” in the “number of cutpoints” field. The width(%)
filed now indicates that each interval is 25% of the cases wide. Experiment with different
values. For example, if you input “2” cutpoints each interval will be 33% of the cases
wide. This would be useful if you wanted to break the scores into “high”, “medium” and
“low”. When done experimenting set the cutpoint to “3” and click the apply button. This
will take you back to the original table.???

Notice that the histogram now has blue vertical lines indicating the locations of the three
cutpoints.
Now we want to label these cutpoints, to do this click “make labels”.
This results in the following view. Notice that SPSS has automatically labeled the
cutpoints.

You can change the labels by clicking on the cells and typing a new label.

Now give the banded variable a name (try zooband) and click OK. SPSS will say that it is
going to create 1 new variable click OK again. This will send you to the output screen
switch to the data editor screen. Now create a frequency table using your new banded
variable by going to analyze > descriptive statistics > frequencies.

Place the banded variable into the right hand column and click OK. You will get the
following table.
zoo story (Banded)

Cumulative
Frequency Percent Valid Percent Percent
Valid <= 4.3 19 25.0 25.0 25.0
4.4 - 7.8 19 25.0 25.0 50.0
7.9 - 13.0 22 28.9 28.9 78.9
13.1+ 16 21.1 21.1 100.0
Total 76 100.0 100.0

The table above is much easier to interpret. Notice that the 3rd quartile is not at the 75th
percentile; this is because the score of 13 is a modal value.

Histograms

Throughout the course we will be looking at the shape of a variable’s distribution.


Histograms are a nice way to visually represent the data. To create a histogram click
graphs > histograms. See below.

This will result in the following menu.


Place zoo story in the variable field and check the “display normal curve” box. You will
get a histogram that looks like this.

15

12

F re q u e n c y
9

Mean = 8.77
Std. Dev. = 5.3755
N = 76
0
0.0 5.0 10.0 15.0 20.0 25.0

zoo story

Displaying the normal curve can confuse the eye and suggest the distribution is normal.
In the case of this variable it is fairly normal with a little positive skew. On the side the
mean and standard deviation of the variable are listed which is helpful.

Boxplots

Another way to visually represent data is with boxplots. In the tutorial dataset there are
two conditions. One condition viewed pictures of toys and the other condition
manipulated toys that represented story events. The zoo story was used as a pretest to
determine if the to conditions were equivalent in the beginning. To create a boxplot click
graphs > boxplot. This results in the following menu.

Highlight “simple” and click define.


自己做:
Place “zoo story” in the variable field and “activity vs. picture” in the category axis and
click OK. This will result in two boxplots (0 = pictures and 1 = manipulation).

25.0
17

20.0

15.0
zoo story

10.0

5.0

0.0

0 1

activ vs picture

Stem and Leaf Plots

Another way to visually represent data is with stem and leaf plots. To do this click
analyze > descriptive statistics > explore. This will result in the following menu.
Place “zoo story” in the dependent list and click on the bubble for plots. Then click OK.
You should see the following table.

zoo story Stem-and-Leaf Plot

Frequency Stem & Leaf

22.00 0 . 0111222222333334444444
25.00 0 . 5556666667777777888899999
19.00 1 . 0000111233333334444
6.00 1 . 556669
4.00 2 . 0013

Stem width: 10.0


Each leaf: 1 case(s)

If you scroll down a little further you will also see a boxplot of the variable. Try going
back to the menu and including “active vs. picture” in the factor list. This will give a
different representation of the data.

Descriptive Statistics

Throughout the course we will be looking at summary statistics for variables. The most
common ones we will use are the mean, variance and standard deviation. To calculate
these values click analyze > descriptive statistics > descriptives. This will result in the
following menu.
Place zoo story in the variables box and check the “save standardized values” box. OK.
Saving the standardized values will give you z-scores for each subject. Now click the
“options” button to see the following menu.

By default SPSS will calculate the mean, standard deviation, range, minimum and
maximum. We need the variance (it really should be a default option) in this class so
check the variance box. Now click continue and then OK on the next menu to see the
table below.
Descriptive Statistics

N Range Minimum Maximum Mean Std. Deviation Variance


zoo story 76 23.0 .5 23.5 8.770 5.3755 28.896
Valid N (listwise) 76

You might also like