SPSS Tutorial
- Setting up the data file -
You are going to create a simple data file in SPSS and learn to manipulate the
data. This procedure is very step-by-step as not too lose those who have never
been this way before.
Let's assume we've completed a survey of twelve people who have completed a weight
reduction program.
Each person is sequentially assigned an ID number. We've asked them their height,
original weight, sex, political party, weight after the weight reduction program,
and eight questions from an extroversion questionnaire.
First, you'll need to open SPSS from the desktop. It should look something like
Figure 1 below. You've got a blank slate. It's always best to plan your
data set before you just randomly plug in variables. We're going to enter the
data for each person as follows:
Table 1
- ID number (id)
- sex (sex)
- height, inches (height)
- weight before the program (before)
- weight after the program (after)
- political party affiliation (party)
- eight questions about extroversion (e1 through e8)
Since SPSS is rather specific about what you name your variables (variables are
limited to certain alphanumeric characters and a length of eight characters),
we're going to use the names in paranthesis as our variable names.
Figure 1:
(Note: The numbers are going to coincide with the numbers in the figures so
you'll know exactly where you should be as you follow this guide.)
1) Double-click on the "var" at
the top of the column. A dialog box will appear like in Figure 2.
2) Change the default text in the field
that the arrow is pointing to ("VAR00001") to "id", the first
of our variable names.
Figure 2:
3) Click on the "Type" button. This
brings up the box in Figure 3.
4) Notice that the type is "Numeric."
5) Change the "Width" to 3 and the
"Decimal Places" to 0. Click on Continue for this box. Then click on
the OK for the first box. You've now defined the first variable.
Figure 3:
6) (See Figure 1) Click into the first
white box under the "id" column. Type "1." This is
the ID number of the first subject. Proceed down the column entering ID numbers
from "1" to "12."
7) Double click on the top of the next column
to the right of id to name it "sex." Under "Type"
set the width to 1 and "Decimal Places" to 0. After you're
done with that, click on the "Labels" button (see Figure 2); this will bring up a dialog
box like the one in Figure 4.
8) Set the "Variable Label" to
"Sex."
Figure 4:
9) Under "Value" type a 1,
and under "Value Label" type "Male." Click the "Add"
button. Now make "Value" 2 and "Value Label" "Female."
Click the "Add" button again. Click Continue. Click OK. What we just
did here is use numbers to represent the values for sex.
You'll need to put in twelve values under the sex column. Use the following
data: 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2.
Now, using what you've learned so far, create the remaining variables with the
data given below:
- Variable Name: height
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 76, 59, 67, 65, 63, 72, 70, 68, 69, 74, 68, 63.
- Variable Name: before
- Type: Numeric, Width = 3, Decimal Places = 0
- Labels: Variable Label = "Weight before"
- Enter these data: 185, 113, 145, 156, 106, 191, 155, 165, 175, 180, 135, 118.
- Variable Name: after
- Type: Numeric, Width = 3, Decimal Places = 0
- Labels: Variable Label = "Weight after"
- Enter these data: 176, 90, 140, 135, 100, 184, 130, 158, 165, 172, 120, 102.
- Variable Name: party
- Type: Numeric, Width = 1, Decimal Places = 0
- Labels: Variable Label = "Political party"
- Labels: Value Labels: "1" = "Democrat", "2" = "Republican", "3" = "Other"
- Enter these data: 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2.
- Variable Name: e1
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 5, 6, 5, 5, 5, 5, 3, 4, 6, 5, 7, 5.
- Variable Name: e2
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 3, 7, 5, 6, 4, 4, 6, 4, 4, 2, 5, 3.
- Variable Name: e3
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 5, 5, 6, 4, 5, 4, 7, 6, 3, 3, 6, 5.
- Variable Name: e4
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 4, 6, 7, 7, 6, 5, 5, 6, 5, 5, 4, 7.
- Variable Name: e5
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 6, 5, 6, 7, 6, 3, 6, 5, 6, 7, 6, 4.
- Variable Name: e6
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 4, 6, 4, 6, 5, 2, 4, 5, 5, 7, 5, 6.
- Variable Name: e7
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 3, 7, 3, 5, 4, 6, 3, 2, 3, 4, 3, 3.
- Variable Name: e8
- Type: Numeric, Width = 2, Decimal Places = 0
- Enter these data: 3, 6, 3, 5, 5, 1, 3, 3, 2, 3, 5, 2.
Your file should look like Figure 5. You can save your file under the
pulldown menu File: Save.
Figure 5:
Go to Part II.