Anda di halaman 1dari 35

Data Analysis with SPSS

Lecture Two

Nantongo Bartha K. A.

Data entry categorical variables


When we enter categorical variables, we
will represent each category by a number.
This is just to make it simpler. It does not
matter what numbers we use, but usually
we use whole numbers starting with 1.

Nantongo Bartha K. A.

Activity
Lets us include the participants genders, Enter the data with your
chosen code, eg 1=male and 2 = female
We need to tell SPSS what these numbers mean.

Go to variable view
Name the variable Gender
Change decimal places to 0
Click the cell for values,
Three dots appear
Click them and a new dialogue box comes up
To show that 1 represents male,
Enter 1 in value and male in label
Click add

Repeat for 2 and female


Click ok

Now if you go to data view, you can choose whether to show the
genders by their numbers or their labels
To change click on view value labels
Nantongo Bartha K. A.

Activity - Labels

Nantongo Bartha K. A.

Activity - values

Nantongo Bartha K. A.

Descriptive statistics categorical


variables
To get descriptive statistics for categorical variable;
Click on Analyze- Descriptive statistics
Frequencies.
A dialogue box appears
Move the categorical variable (Gender) across to
the variable box.
Click ok
The output shows the number and the
percentage of participants in each category.

Nantongo Bartha K. A.

illustration

Nantongo Bartha K. A.

Activity
Revise all graphs in excel

Nantongo Bartha K. A.

Histograms ; Chart editor


Histograms are a way of visualizing a single variable.
To produce a histogram in SPSS
On the drop-down menu, click on graphs legacy dialogs
histogram
Move the variable of interest (eg age) into the variable box
Click the box to Display normal curve (if required. This helps to
visualize whether the data are normal. If the sample was drawn
from a normal population, you expect the histogram to lie close
to the normal curve. As you will find out, this is quite hard to
judge with small samples)
Click ok
Nantongo Bartha K. A.

Histogram illustration

Nantongo Bartha K. A.

Changing the appearance of a


chart using the chart Editor
We can change the formatting and settings of
any chart in SPSS using the chart editor.
To open it,
double click on the graph
You can then bring up dialog boxes to change various
features, either from the drop down menu at the top
Or to single click first, and / or try more than once in
slightly different places to get the dialog box you want

Nantongo Bartha K. A.

Illustration after editing

Nantongo Bartha K. A.

Descriptive statistics.
To get descriptive statistics for categorical variable;
Click on Analyze- Descriptive statistics
Frequencies.
A dialogue box appears
Move the categorical variable (Gender) across to
the variable box.
Click charts and one of your choice
Click ok
The output opens describing the chosen data

Nantongo Bartha K. A.

The viewer window (output window)


Viewer window is where you see the statistics and
graphics (the output) from your work /data.
As shown in the figure above, the viewer window is split
into two parts / panes.
The left side is called outline pane contains an outline view of all
the different pieces of output in the viewer, whether or not they are
currently visible.
The right side is called display pane contains the output itself.

To change the size of the two panes, click at the line that
divides them then drag.
Nantongo Bartha K. A.

Output / viewer window

Outline pane

Display pane

Nantongo Bartha K. A.

The outline pane


Individual portions of output are associated with
book icons in the outline pane.

Each icon represent a particular piece of output, such


as a table of statistics or a chart
If you click one of them, the associated piece of output
appears instantly in the display pane
These icons are the quickest navigational controls in the
viewer.
The book icons are used to hide or display pieces of output
temporally.
The closed book icon represents a hidden piece of output.
Hidden output doesnt appear in the display pane but can be
recovered any time you want to look at it.

Nantongo Bartha K. A.

The outline pane..


To hide a single piece of output, double click the open
book icon. This closes the icon and hides the output
associated with it.
To display a hidden piece of output, double click the
closed book icon
To hide all the out put from a procedure, such as
frequencies, click the little box containing a minus to the
left of the procedure name
Click the plus sign to display it again.
You also re arrange the out put by clicking book icon.
Drag it to a different place in the outline
To delete part of the output, click the icon and press
delete.
Nantongo Bartha K. A.

The display pane


The display pane shows as much of the SPSS
statistics output as can fit in it.
To see more one has to scroll or use the outline pane
to jump around

The output in the display pane includes several


different kinds of objects:
Tables of numbers
A special kind of tables called a pivot table

Charts
Bits of text such as tittles
Nantongo Bartha K. A.

Note
You have complete control over the
appearance and even the content of most
of these objects.
To change some thing about an object,
Double click it in the display pane

Nantongo Bartha K. A.

Viewer Objects
In the outline pane, the first line is a container for the
entire batch of out put. Its simply called output
There might be a line below called log (read about it)
The next line, frequencies, is a heading that contains all
of the various kinds of out put produced by the
frequencies procedure that you just ran. Ie;
Title:
the title of the procedure, which is simply text

Notes:
notes are usually hidden, so this probably looks like a closed book
in the outline

Active Dataset:
since you can have more than one data file open in SPSS statistics,
this identifies the file used for this procedure
Nantongo Bartha K. A.

Viewer Objects
Statistics;
This is a pivot table that reports the number of
cases, or observations , that were
processed by the frequency procedure. Most
procedures start by producing such a table.

A frequency table for the variable age,


the first variable analyzed, which is a
descriptive label that was assigned to the
variable age when the data file was set up.
Nantongo Bartha K. A.

Pivot tables
Most SPSS statistics tabular and statistical
output appear in the viewer in the form of
pivot tables;

Nantongo Bartha K. A.

Illustration

Nantongo Bartha K. A.

Pivot tables
In the outline under Frequency table, click the
icon for the pivot table labeled gender.
The table instantly appears in the display pane,
with an arrow pointing to it, as shown in the
illustration above
Double click on the table itself to indicate that
you want to edit it
Right click to see more options
Nantongo Bartha K. A.

Illustration

Nantongo Bartha K. A.

The Data editor window


Its an array of rows and columns.
Each row is a case, and each column is a variable.
Cases and variables are fundamental concepts in data
analysis.
Cases (rows):
Are the people / items who participate in a survey or experiment
or
The case is the unit for which you take measurement
Eg, if you are doing experiments about rats, the case is the
individual rat
If you are studying beef content of hamburgers, each hamburger is a
case

Nantongo Bartha K. A.

The Data editor window

Columns
Are variables

Rows are cases

Nantongo Bartha K. A.

The Data editor window


Variables (columns) are the different items of
information that you collect for your cases.
Think about the way you conduct a survey, you ask each person
for the same type of information: DOB, Gender, Status,
education, views on whatever subject your survey is about.
Each item for which you record an answer is known as a
variable.
The answer a particular person gives is called a value for that
variable.

The intersection of the row and a column is called a cell.


Each cell holds the value of a particular case for a particular
variable.
Nantongo Bartha K. A.

Entering Non Numeric Data


To enter non numeric data into a column, you must first
specify the variable type in the variable view of the data
life.
Create a new variable and define it as a string variable.
String means words or characters

Click the variable view tab


In the Name column, type respname
In the type column, click cell
Three dots appear, click them
A dialog box appears, select string
Enter the number of characters
Click ok
Click data view to enter data
Nantongo Bartha K. A.

Illustration

Nantongo Bartha K. A.

Sources of Data
What is important when designing a
survey or an experiment?
How should you ask a question?
How should you select participant?
How should you assign people to
experimental groups?
Why is it important to include a comparison
group?

Nantongo Bartha K. A.

Sources of data
Sources are;
Surveys
Experiments

Nantongo Bartha K. A.

Sources of data summary


What is important when designing a survey or an
experiment?
You should carefully formulate the questions that you are going
to ask
You must determine what the population of interest is and select
a random sample of objects or people from that population
You must make sure that you dont bias your sample by making
it more likely that some members are included than on others
You must collect information in an objective fashion. The
procedures for gathering information must be standardized
If several different experimental conditions are being compared,
you must randomly assign the subjects to groups
You must prevent subjects and researchers form allowing their
personal prejudices to influence the outcome of the investigation
Nantongo Bartha K. A.

Counting Responses

Nantongo Bartha K. A.

End

Nantongo Bartha K. A.