Beruflich Dokumente
Kultur Dokumente
Introduction to SPSS
Lecturer of Biostatistics & Assistant Director
Department of Research
Dow University of Health Sciences
waqas.ahmed@duhs.edu.pk
Introduction to
SPSS
Object of the Course
• About SPSS
Click
Variable View Window
• This sheet contains information about the data set that is stored
with the dataset
• Name
– The first character of the variable name must be alphabetic
– Variable names must be unique, and have to be less than 64
characters.
– Spaces are NOT allowed.
– For separating two names use “_” , “$” , “ .”
Variable View Window: Type
• Type
– Click on the ‘type’ box. The two basic types of variables
that you will use are numeric and string. This column
enables you to specify the type of variable.
Variable View window: Width
• Width
– Width allows you to determine the number of
characters SPSS will allow to be entered for the
Variable in a single cell
Variable View window: Decimals
• Decimals
– Number of decimals
– It has to be less than or equal to 16
3.14159265
Variable View window: Label
• Label
– You can specify the details of the variable
– You can write characters with spaces up to 256
characters
Variable View window: Values
• Values
– This is used and to suggest which
numbers represent which categories when
the variable represents a category
Defining the value labels
• Click the cell in the values column as shown below
• For the value, and the label, you can put up to 60
characters.
• After defining the values click add and then click OK.
Click
Practice 1
• How would you put the following information into
SPSS?
N am e G ender H e ig h t
J A U N ITA 2 5 .4
SALLY 2 5 .3
D ONNA 2 5 .6
S A B R IN A 2 5 .7
J OHN 1 5 .7
M ARK 1 6
E RIC 1 6 .4
B RUC E 1 5 .9
Click
SPSS File: Data Entry Practice.sav
SPSS File: Data Entry Practice.sav
Practice 2
• How would you sort the data by the
‘Height’ of students in ascending order?
SPSS File: Data Entry Practice.sav
Transforming data
• Click ‘Transform’ and then click ‘Compute Variable…’
SPSS File: Data Entry Practice.sav
Click
SPSS File: Data Entry Practice.sav
Practice 3
• Create a new variable named “sqrtheight”
which is the square root of height.
SPSS File: Data Entry Practice.sav
Practice 3
• A new variable ‘sqrtheight’ is added to the data
SPSS File: Data Entry Practice.sav
Practice 4
Removing a Variable
“Gender” by right click
on it and select
“Clear”.
Adding a Variable
before Height by right
click on it and select
“Insert Variable”.
SPSS File: Data Entry Practice.sav
Practice 5
Removing a
Case/Observation “5”
from the data by
clicking right on it and
select “Clear”.
Adding a
Case/Observation
before “3” from the
data by clicking right
on it and select
“Insert Cases”.
SPSS File: Data Entry Practice.sav
Practice 6
Addition of the Two new variables having same
options. Let say we want to add “Back Pain” and
“Headache” with “Yes” or “No” option.
SPSS File: Data Entry Practice.sav
Practice 6
For adding another variable with the same structure
we just copy and paste in below row.
SPSS File: Data Entry Practice.sav
Practice 6
Change the name and label for the new variable.