Graph Procedure
STC224
Introduction
• SPSS can be used to create a number of
commonly used graphs, including bar charts,
histograms, scatterplots, and boxplots, etc
Bar Charts
• Bar charts indicate the frequency, or number
of observations, for each category of a
variable (bar charts are typically produced on
categorical variables).
• We’ll create a bar chart for college
To create a bar chart in SPSS
• From the menu bar select Graphs>Legacy
Dialogs>Bar (see Figure below).
Bar chart in SPSS cont’d
• The Bar Charts dialog box opens. To create a
bar chart for college, the default option,
Simple, will be used. Click Define (see Figure
below)
Bar chart in SPSS cont’d
• The Define Simple Bar: Summaries for Groups
of Cases dialog box opens. Select college and
click the second right-arrow button ( ) from
the top to move it to the Category Axis box.
See Figure below for details.
• Click OK.
The Define Simple Bar: Summaries for
Groups of Cases dialog box.
Bar chart for college is produced in the
Viewer window
Interpret the Bar Chart Results
• Bar Chart — College
• In the bar chart of college shown in Figure above the
groups (home and away) are displayed on the
horizontal axis (X-axis) and the frequency (labeled
Count) is displayed on the vertical axis (Y-axis).
• On the vertical axis of the bar chart, the height of the
bar corresponds to the frequency for a given group.
• The bar chart indicates that six of the students
attended college at home, while four of the students
attended college away.
Histograms
• Histograms are graphs that indicate the frequency,
or number of observations, for intervals of a
continuous variable.
• We’ll create a histogram for the variable mathexam.
1. To produce a histogram in SPSS, from the menu bar
select Graphs > Legacy Dialogs > Histogram
2. The Histogram dialog box opens.
3. Select mathexam and click the upper right-arrow
button ( ) to move it to the Variable box
4. Click OK.
Menu commands for the Histogram
procedure
The Histogram dialog box
A histogram of mathexam is produced in
the Viewer window
Interpret the Histogram Results
• Histogram — Mathexam
• The histogram shown in Figure above displays the values of
mathexam (from smallest to largest) on the X-axis and the
frequency on the Y-axis.
• Notice on the X-axis that each bar in the graph spans a 5-point
range: The first bar has a midpoint of 15, the second bar has a
midpoint of 20, and so on (the midpoints will vary from one
histogram to another).
• The value with the greatest frequency in the graph is for a
midpoint of 25, which has a frequency of 4.
• Notice that SPSS reports the mean, standard deviation, and
sample size to the right of the graph by default
Scatterplots
• Scatterplots plot the coordinates (a point
where the scores on two variables meet) of
participants’ responses on two variables and
are often used when calculating correlation
coefficients
• We’ll create a scatterplot of the variables
mathexam and satquant.
To create a scatterplot in SPSS
1) To produce a scatterplot, from the menu bar
select Graphs>Legacy Dialogs> Scatter/Dot
(see Figure below).
Create a scatterplot in SPSS cont’d
2) The Scatter/Dot dialog box opens (see Figure
below). To produce a scatterplot of
Mathexam and satquant, the default option,
Simple Scatter will be used. Click Define.
Create a scatterplot in SPSS cont’d
4) The Simple Scatterplot dialog box opens.
Select mathexam and click the upper right-
arrow button ( ) to move it to the Y Axis box.
Select satquant and click the second right-
arrow button ( ) to move it to the X Axis box
5) Click OK.
The Simple Scatterplot dialog box
A scatterplot of mathexam and satquant is
produced in the Viewer window
Interpret the Scatterplot Results
• Scatterplot — Mathexam and Satquant
• The scatterplot shown in Figure above displays the coordinates
(each coordinate is indicated by a circle in the plot) for each of
the participants on the variables mathexam and satquant.
• As we specified in the Simple Scatterplot dialog box earlier, the
values of mathexam are on the Y-axis and the values of
satquant are on the X-axis.
• There are 10 different coordinates in the plot, with each
coordinate displaying the scores on the two variables for an
individual.
• The coordinate on the far right of the plot, for example,
represents the scores on mathexam and satquant for the third
participant, with scores of 34 and 600, respectively
Boxplots
• Boxplots are useful for displaying information
about a variable including the center (median),
the middle 50% of the data, the overall spread,
and whether or not there are any outliers in the
data
• NB: (Outliers are points that are unrepresentative
of the other values in the data set).
• We’ll produce a boxplot for the variable
mathexam
To create a boxplot in SPSS
1) To create a boxplot, from the menu bar select
Graphs>Legacy Dialogs> Boxplot
•
Create a boxplot in SPSS cont’d
2) The Boxplot dialog box opens. Leave the
default option, Simple, selected. In the Data
in Chart Are section of the dialog box, select
Summaries of separate variables. (see below)
Create a boxplot in SPSS cont’d
3) Click Define.
4) The Define Simple Boxplot: Summaries of
Separate Variables dialog box opens. Select
the variable, mathexam, and click the upper
right-arrow button ( ) to move it to the Boxes
Represent box (see Figure below).
5) Click OK.
The Define Simple Boxplot: Summaries of
Separate Variables dialog box.
A boxplot for mathexam is produced in the Viewer window
Interpret the Boxplot Results
• Boxplot — Mathexam
• The boxplot of mathexam shown in Figure above summarizes
the scores differently from the histogram that was calculated
on mathexam earlier.
• In the boxplot, the rectangular box contains the middle 50%
of the data, and the line inside the box is equal to the
median. The lines extending from the box correspond to the
whiskers.
• The two end points of the whiskers represent the minimum
and maximum values, except in the case when there are one
or more outliers, which would be shown as an asterisk falling
outside of the whiskers (an example of a boxplot with an
outlier is provided in the end-of-chapter exercises)
Activity
• Attempt question 3 from the exercises section
on pg. 47 (SPSS Demystified. A Step-by-Step
Guide to Successful Data Analysis )