0% found this document useful (0 votes)
51 views46 pages

SPSS - Training - Section 2&3

Here are the steps to define variables in SPSS: 1. Enter the variable name in the Name column 2. Select the variable Type (string, numeric, date) 3. Enter a descriptive Label 4. Select the Measure (nominal, ordinal, scale) 5. Optionally specify Width, Decimals, Values, Missing etc. based on the variable This defines the variables so you can now enter data values. Let me know if any part needs more explanation!

Uploaded by

biniam yohannes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views46 pages

SPSS - Training - Section 2&3

Here are the steps to define variables in SPSS: 1. Enter the variable name in the Name column 2. Select the variable Type (string, numeric, date) 3. Enter a descriptive Label 4. Select the Measure (nominal, ordinal, scale) 5. Optionally specify Width, Decimals, Values, Missing etc. based on the variable This defines the variables so you can now enter data values. Let me know if any part needs more explanation!

Uploaded by

biniam yohannes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Practical Statistical Training

Using SPSS Software

Trainer – Hailegebriel Yirdaw


(PhD Candidate at AAU and University of Gothenburg)
E-mail: [email protected]

1
Trainer: Hailegebriel Yirdaw 2
Getting Started with
SPSS Windows
SPSS is an abbreviation that stands for
Statistical Package for Social Sciences
One of the most popular statistical
packages which can perform highly
complex data manipulation and analysis
with simple instructions
It is comprehensive and flexible software used
for data management and analysis
Takes data from almost any type of file and
then use them to generate outputs and
conduct complex statistical analysis
Trainer: Hailegebriel Yirdaw 3
How to start SPSS
After installation the software will be
available from Start menu, under Programs,
or can have a shortcut on our Desktop.

To start SPSS
◦ either select it from the Start menu, or
◦ activate the Desktop icon.
◦ Start  Program  IBM SPSS Statistics 
Trainer: Hailegebriel Yirdaw 4
First start up of SPSS looks like :

Trainer: Hailegebriel Yirdaw 5


The Data Editor screen
Menu Bar

Tool Bar

Data Editor

Trainer: Hailegebriel Yirdaw 6


Main Windows in SPSS
The Data View Window - displays the raw data which
is used for analysis purpose.
◦ Used to display data
◦ Columns represent variables
◦ Rows represent individual units or groups of
units that share common values of variables
◦ Possible to directly add, delete or move data or/and
variables.

Trainer: Hailegebriel Yirdaw 7


Variable View Window – it is where
variables are defined. To open it:
◦ Go to the View menu and select Variables
◦ Click on the Variable View tab at the bottom
of the screen
◦ Used to display information on variables in
dataset

Trainer: Hailegebriel Yirdaw 8


Variables

Values

Cases

Trainer: Hailegebriel Yirdaw 9


The Output Viewer - All output from
statistical analyses is printed to the Output
Viewer window.
◦ When you execute a command the output will
automatically be printed in the Output Viewer.

Trainer: Hailegebriel Yirdaw 10


Activity 1.(3 minutes)

Reopen SPSS windows and see the


different components that you have
discussed earlier and clearly identify the
data editor window from the variable
view window.

Trainer: Hailegebriel Yirdaw 11


Trainer: Hailegebriel Yirdaw 12
Data View window
The Data View window
This sheet is visible when you first open the Data Editor
and this sheet contains the data
Click on the tab labeled Variable View

Click

Trainer: Hailegebriel Yirdaw 13


Variable View window

Trainer: Hailegebriel Yirdaw 14


Enter Variables
1. Click Variable View
2. Type variable name
under Name column
2.Type (AGE).
4. Description
variable
name
of variable NOTE: Variable name can
3.Type: be 64 bytes long, and
numeric or the first character must
string be a letter or one of the
characters @, #, or $.
3. Type: Numeric, string,
1. Click this etc.
Window 4. Label: description of
variables.

Trainer: Hailegebriel Yirdaw 1515


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.
◦ Click in the Name cell  write the variable name

Trainer: Hailegebriel Yirdaw 16


Definition of variables
10 characteristics are used to define a variable:

Name Values
Type Missing
Width Column
Decimals Align
Label Measure

Trainer: Hailegebriel Yirdaw 17


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.
◦ String Variables: Texts such as names of persons, places or items
such as names of household members, wereda, kebele, village names,
etc.
◦ Numeric variables: Are variables that are either numbers or coded
into numbers

Trainer: Hailegebriel Yirdaw 18


Variable View window: Width
Width
◦ Width allows you to determine the number of
characters SPSS will allow to be entered for the
variable
◦ Click in the Width cell  use the up/down arrow to
increase and decrease the width

Trainer: Hailegebriel Yirdaw 19


Variable View window: Decimals
Decimals
◦ Number of decimals
◦ It has to be less than or equal to 16
◦ Click in the Decimal cell  use the up/down arrow to
increase and decrease the decimal (Works for numeric
data)

3.14159265L

Trainer: Hailegebriel Yirdaw 20


Variable View window: Label
Label
◦ You can specify the details of the variable
◦ You can write characters with spaces up to 256
characters

Trainer: Hailegebriel Yirdaw 21


Variable View window: Values
Values
◦ This is used and to suggest which numbers
represent which categories when the variable
represents a category
◦ To define the meaning of the values you have used to
code your variables
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

Trainer: Hailegebriel Yirdaw 22


Enter variables

Based on your
code book!

23 23
Data Entry

How to Define a Variable


Name Type Label Value Measure
id Employee Code
gender Gender of respondents F= female, M = male
bdate Date of Birth of respondents
educ Educational Level (years)
jobcat Employment Category 1=clerical, 2=custodial,
3=manager
salary Current Salary
salbegin Beginning Salary
jobtime Months since Hire
prevexp Previous Experience
(months)
minority Minority Classification 1 = no, 2 = yes

Trainer: Hailegebriel Yirdaw 24


Width: The default value for Width is 8.
It’s enough for most data. For string
variables you may need to increase it
upward
Click in the Width cell  use the up/down
arrow to increase and decrease the width
Decimal : You can change the Decimal
Label
Click in the Decimal cell  use the up/down
arrow to increase and decrease the decimal
(Works for numeric data)

Trainer: Hailegebriel Yirdaw 25


Missing : Sometimes researchers assign
specific values to indicate missing values
for their data
◦ Giving different values for different missing
values could be helpful for later analysis
◦ Example: 99= I don’t know, 66= not willing
to respond and 9=wrong responses
Click in the Missing cell  click the grey button
 Missing Value window will appear 
Choose the option discrete missing values
type the Value Ok

Trainer: Hailegebriel Yirdaw 26


Column – gives the width of the column
Click in the Column cell  use the up/down arrow
to increase and decrease the width of the column
Align - the alignment of the data in the
columns is usually (can be set to left,
middle or right)
Click in the Align cell  use the arrow to change

Trainer: Hailegebriel Yirdaw 27


Measure - refers to the level of
measurement of each variable (scale,
ordinal, nominal).
◦ Scale which refers to continuous data
measured at interval or ratio level of
measurement
◦ Nominal - for categorical data
◦ Ordinal - categorical data that involve
rankings or ordered values
Click in the Measure cell  use the arrow to
select

Trainer: Hailegebriel Yirdaw 28


Measure
Levels of measurement:
◦ Nominal
◦ Ordinal
◦ Interval
◦ Ratio
In SPSS, interval and ratio are designated
together as Scale
The default for string variables is Nominal
The default for numeric variables is Scale

Trainer: Hailegebriel Yirdaw 29


Data Entry

How to Define a Variable


Name Type Label Measure
id Numeric Employee Code Scale
gender String Gender Nominal
bdate Date Date of Birth Scale
educ Numeric Educational Level (years) Ordinal
jobcat Numeric Employment Category Ordinal
salary Dollar Current Salary Scale
salbegin Dollar Beginning Salary Scale
jobtime Numeric Months since Hire Scale
prevexp Numeric Previous Experience (months) Scale
minority Numeric Minority Classification Ordinal

Trainer: Hailegebriel Yirdaw 30


The following table shows the different
types of measurement, with examples:
Nominal Category Discrete Eye colour

Ordinal Ranking Discrete Likert Scale, e.g. 1-5, for


(rating) example:
Excellent-good-fair-poor-terrible

Interval Scale Continuous Temperature

Ratio Scale Continuous Age, years of education

Trainer: Hailegebriel Yirdaw 31


Trainer: Hailegebriel Yirdaw 32
SPSS file format

…SAV

…SPV

…SPS

Trainer: Hailegebriel Yirdaw 33


Activity 1. (10 minutes)

Dear trainee, use “Expenditure data” to


define the variables based on the description
provided at Exercise1.

Activity 3. (10 minutes)

Dear trainee, use “Sample Survey


Questionnaire” to define the variables
based on the description provided at
Exercise1.

Trainer: Hailegebriel Yirdaw 34


How to Enter the Data

To enter the data you need to switch to


the Data view window.
Click on the first cell Type in the number 
Press the down arrow key on your key board
 Move across the column entering all the
information
The process continues until you fill our
information for all the variables.

Trainer: Hailegebriel Yirdaw 35


Making changes
◦ Delete Cases: Select the case you want to
delete –press the delete button
◦ Insert cases between existing cases:
Move your cursor to a cell immediately below
where you would like the new cases to
appear.
Click Edit Menu and choose insert case - an empty
row will appear which you can enter the data for
the new case

Trainer: Hailegebriel Yirdaw 36


◦ Deleting Variable: Select the variable by
selecting the whole column - press the delete
button on your desktop.
◦ Insert Variables between existing
variables: Position your cursor in a cell in
the column (variable) to the right of where
you would like the new variable to appear
Click Edit Menu and choose insert variable - an
empty column will appear which you can enter the
data for the new case.

Trainer: Hailegebriel Yirdaw 37


Activity 2. (15 minutes)

Based on the activity you performed


under activity 2 use the variables you
defined to enter the “Expenditure data”

Trainer: Hailegebriel Yirdaw 38


Data Loading
So far we have seen how to enter data
from the hard copies directly to the Data
Editor Window
Data sets could be prepared in MS Excel
and then imported into SPSS for analysis.
The steps to import data from Excel is as
follows
 Set up an Excel spreadsheet with the variable
names in the first row across the page
Trainer: Hailegebriel Yirdaw 39
 SelectFile  open  Data From Files type
box. Scroll down and select Excel (*.xls)
Select the Excel spreadsheet prepared
Click the Open button  The Opening Excel
Data Source dialog box will be opened  Read
variable names (to import the name of the
variables in the first row as it is)  Continue
Note
◦ If your spreadsheet has column names at the
start of each column those selected will be
kept as variable names in SPSS
◦ To import part of a spreadsheet, enter the
range of cells from the spreadsheet that you
want to import in the Range box (A1:K20)
Trainer: Hailegebriel Yirdaw 40
Open Excel files in SPSS

Trainer: Hailegebriel Yirdaw 41 41


Activity 2. (6 minutes)

• Use the “Expenditure data” given in


Microsoft Excel form use import option
to load it into SPSS.

• Use the “hhexp96 data” given in STATA


file form use import option to load it into
SPSS.

Trainer: Hailegebriel Yirdaw 42


Data Saving
The file must always be saved in order to
save the work that has been done to date:
◦ File/Save
◦ Move to the target directory
◦ Enter a file name
◦ Save
Data Saving
To save data as SPSS file
 Go to the File menu 
1) Either select Save if you want to save the file
using the current name, or
2) Select Save As if you want to specify a different
file name (Make sure that the Save As Type is
set as SPPS(*.Sav)

Trainer: Hailegebriel Yirdaw 44


Activity 3.(2 minutes)

Save the data you imported from


Microsoft Excel (in activity 4) to use it for
analysis in subsequent sections on the
desktop of your PC.

Trainer: Hailegebriel Yirdaw 45


To quite SPSS
◦ Select File from the main SPSS menu bar, and
then Exit.
To Restart SPSS
Go to the File menu and select Open  Data 
Select the file Click on the Open button  Then
select the Data from the resulting sub-menu  Open

Activity 4.(1 minute)

Quit what you have done and reopen it.

Trainer: Hailegebriel Yirdaw 46

You might also like