You are on page 1of 28

Statistical Decision Making

AQ054-3-M and Version 3

Introduction to SPSS
Topic & Structure of The Lesson

 Data Entry
 Data Labelling
 Analyse using Graphical Presentation
 SPSS Application

AQ054-3-M-Statistical Decision Making Introduction to SPSS Slide <2> of 9


Learning Outcomes

• At the end of this topic, You should be able


to
 Carry out statistical analysis and perform
the necessary calculations such as
present data graphically, data entry and
data labelling using SPSS.

AQ054-3-M-Statistical Decision Making Introduction to SPSS Slide <3> of 9


Key Terms You Must Be Able To
Use
• If you have mastered this topic, you should be able to use the following
terms correctly in your assignments and exams:

AQ054-3-M-Statistical Decision Making Introduction to SPSS Slide <4> of 9


Data Entry

There are 2 ways to enter data into SPSS:

1. Directly enter in to SPSS by typing in Data View

2. Enter into other database software such as Excel


then import into SPSS

AQ054-3-M-Statistical Decision Making Introduction to SPSS 5


SPSS Data View

AQ054-3-M-Statistical Decision Making Introduction to SPSS 6


SPSS Variable View

AQ054-3-M-Statistical Decision Making Introduction to SPSS 7


Data Entry
1. Give each variable a valid name (8 characters or less with no spaces or
punctuation, beginning with a letter not a numeric number). Short, easy to
remember word names. Avoid the following variable names: TEST, ALL, BY, EQ,
GE, GT, LE, LT, NE, NOT, OR, TO, WITH. These are used in the SPSS syntax
and if they were permitted, the software would not be able to distinguish between
a command and a variable. Each variable name must be unique; duplication is
not allowed. Variable names are not case sensitive. The names NEWVAR,
NewVar, and newvar are all considered identical.

2. Encode categorical variables. Convert letters and words to numbers.

3. Avoid mixing symbols with data. Convert them to numbers.

4. Example: Give each patient a unique, sequential case number (ID). Place this
ID number in the first column on the left

AQ054-3-M-Statistical Decision Making Introduction to SPSS 8


5. Each variable should be in its own column.

Avoid this: Change to:

Animal Animal Group


Control1 1 0
Control2 2 0
Experiment1 3 1
Experiment2 4 1

* Do not combine variables in one column

* It is recommended to use 0/1 for 2 groups with 0 as a reference group.

6. All data for a project should be in one spreadsheet. Do not include graphs or
summary statistics in the spreadsheet.

AQ054-3-M-Statistical Decision Making Introduction to SPSS 9


7. Examample: Each patient should be entered on a single line or row. Do not
copy a patient’s information to another row to perform subgroup analysis.

8. However when data are repeatedly collected over a patient, it’s recommended
to have patient-day observation on a simple line to ease data management.
SPSS has a nice feature to convert from the longitudinal format to horizontal
format. When the number of repeats are few 2 or 3, horizontal format may be
preferred for simplicity.

Longitudinal data entry Horizontal data entry

Date ID SYSBP ID SYSBP1 SYSBP2 SYSBP3


1/2/2005 1 130 1 130 120 120
1/3/2005 1 120 2 110 140
1/4/2005 1 120
3/1/2005 2 110
3/2/2005 2 140

AQ054-3-M-Statistical Decision Making Introduction to SPSS 10


9. For yes/no questions, enter “0” for no and “1” for yes. Do not leave blanks
for no. Do not enter “?”, “*”, or “NA” for missing data because this indicates to
the statistical program than the variable is a string variable. String variables
cannot be used for any arithmetic computation.

10. Put ordinal variables into one column if they are mutually exclusive.

Avoid: Preferred:

Pain Pain
Mild Moderate Severe
1 0 0 1
0 1 0 2
0 0 1 3

11. Do not make columns wider then 8 characters, unless absolutely essential.

AQ054-3-M-Statistical Decision Making Introduction to SPSS 11


Data Entry (Time in SPSS)
In SPSS, open Variable View, Click Type for the variable you want to
Assign date format, click on Date, and select a format of your choice.

AQ054-3-M-Statistical Decision Making Introduction to SPSS 12


Importing data from Excel spreadsheet into SPSS.

In SPSS, go to:
File, Open, Data
Select Type of file (for example, Excel) you want to open
Select File name you want to open

AQ054-3-M-Statistical Decision Making Introduction to SPSS 13


Importing data from SPSS to Excel.
In SPSS, go to:
Data, Save as,
Select Type of file (for example, Excel) you want to save into
Give File name you want to save into

AQ054-3-M-Statistical Decision Making Introduction to SPSS 14


Recoding existing variables
We want to use numeric coding for group instead of A and B.
Old New

ID Group Group

1 A 0
2 A 0
3 B 1
4 B 1

AQ054-3-M-Statistical Decision Making Introduction to SPSS 15


Recoding existing variables
From SPSS dialog box, go to:
Transform
Recode
Into Same variables

AQ054-3-M-Statistical Decision Making Introduction to SPSS 16


Recoding existing variables

1. Select Group from the variable box into String Variables box
2. Click on Old and new Values to proceed

AQ054-3-M-Statistical Decision Making Introduction to SPSS 17


Recoding existing variables
1. Type the old value and the new value you want to convert into
2. Click on Add (To remove, or change, click on Change or Remove)
3. Type all values in the Old  New box, then click Continue
4. Click OK to execute the commands.

AQ054-3-M-Statistical Decision Making Introduction to SPSS 18


Creating a new variable for Diastolic blood pressure (DiasBP):

In SPSS, go to Variable View,


Then type DiasBP at the last row under Name

Go back to Data View and directly type diastolic blood pressure to separate from
SysBP. For ease of data entry, you can move DiasBP right after SysBP. Now also
edit sysBP.
AQ054-3-M-Statistical Decision Making Introduction to SPSS 19
Data Labeling
HT
61.00
68.00
47.00
66.00
72.00
67.00
72.00
72.00
66.00
60.00
61.00
59.00
73.00
65.00
71.00
68.00
69.00
66.00
66.00
68.00
AQ054-3-M-Statistical Decision Making Introduction to SPSS 20
Data Labeling

AQ054-3-M-Statistical Decision Making Introduction to SPSS 21


Data Labeling
Variable Formatting

AQ054-3-M-Statistical Decision Making Introduction to SPSS 22


Data Labeling
Specifying missing values

AQ054-3-M-Statistical Decision Making Introduction to SPSS 23


Data Labeling
Measurement category

AQ054-3-M-Statistical Decision Making Introduction to SPSS 24


Slide 25 of 93

Analyse using Graphical Presentation

AQ054-3-M-Statistical Decision Making Introduction to SPSS


Summary of Main Teaching Points

AQ054-3-M-Statistical Decision Making Introduction to SPSS Slide <26> of 9


Question and Answer Session

Q&A

AQ054-3-M-Statistical Decision Making Introduction to SPSS Slide <27> of 9


What we will cover next

Descriptive Statistics

AQ054-3-M-Statistical Decision Making Introduction to SPSS Slide <28> of 9

You might also like