Intermediate Workshop
SPSS
CSU Fresno
March 15, 2010
Agenda for the Intermediate
SPSS Workshop
• Cross tabulations
– Bivariate
– Multivariate
• Comparing means
– Independent sample t test
– Paired-sample t test
– One-way analysis of variance
• Regression and correlation
– Bivariate
– Multivariate
• Graphs
Opening the Data Files (.sav) for
this Workshop
• The data files we’re going to use in this
workshop are .sav files.
• One of the data sets that we’re going to
use comes with the text – gss06a.sav.
You can download it from the website that
has the text:
http://www.ssric.org/tr/onlinetextbooks.
Look for the text that says “Right click here
to download GSS06A.”
Opening the Data Files (.sav) for
this Workshop
• We’re also going to use the “states” data set, a file with
information about each of the 50 states.
• You can download the data from
http://www.csupomona.edu/~jlkorey/POWERMUTT/Data
• You can also download a codebook describing it from
http://www.csupomona.edu/~jlkorey/POWERMUTT/Code
books/states.html.
Choosing options within SPSS
• Click on “Edit” and “Options.”
• Under “Variable Lists,” check “Display
Names” and “Alphabetical.”
• Under “Output Labels,” select “Names and
Labels” in the first box, and “Values and
Labels” in the second.
Cross Tabulations
(see chs. 5 and 8 in text)
• Click on Analyze > Descriptive Statistics >
Crosstabs.
• Select PRES04 as the row variable, and
SEX and MARITAL as column variables.
• Click on Cells and check Column.
• Click on Statistics and check Chi Square
and Cramer’s V.
• Click on OK.
Cross Tabulations
(with a control variable)
• Click on Analyze > Descriptive Statistics >
Crosstabs
• Move SEX from second to third dialog box.
• Click on OK.
Copying the Table
• Select the table by single clicking on it.
• Click on Edit and then on Copy.
• Go to your report in Word and click on Edit
> Paste Special > JPEG > OK.
Exercises for Crosstabs
• Using the gss06a.sav data, crosstabulate
actual income (INC06REC) and perceived
income (FINRELA), treating the later as
your dependent variable. Use Kendall’s
tauc to measure association.
• Use crosstabs to test a hypothesis of your
choosing.
Ways to Compare Means
(see ch. 6 in text)
• Independent-sample t test
• Paired-sample t test
• One-way analysis of variance
Computing Means
• Click on Analyze/Compare Means and
then on Means.
• Move AGEKDBRN into the “Dependent
List”.
• Move SEX into the “Independent List”
• Click on OK.
Computing Means (continued)
• Requesting other statistics – click on
“Options” and select the other statistics
you would like.
• Further breakdowns – Click on “Next” and
select a further breakdown.
– Move DEGREE into the “Layer 2” box and
click on “OK.”
– Now move DEGREE into the “Layer 1” box
and SEX into the “Layer 2” box.
Exercises for Comparing Means
• Compute the mean age (AGE) of respondents
who voted for Bush, Kerry, and someone else
(PRES04). Which group had the youngest
mean age and which had the oldest mean age?
• Compute the mean number of hours that people
with different levels of education (DEGREE)
watch television (TVHOURS). Who watches
more television – those with less education or
those with more education?
Independent Sample T Test
• Independent samples are samples where the
composition of one sample does not influence the
composition of the other sample.
• Click on Analyze/Compare Means/Independent Sample
T Test.
• Select the variable that defines the two groups. This is
called the “Grouping Variable”. Let’s use SEX as our
grouping variable.
• Click on “Define Groups” and indicate the values that
define the two groups. Males are coded 1 and females
are coded 2.
• Click on continue.
Independent Sample T Test
• Select the “Test Variable”. This is the
variable that you want to use to compare
the two groups. Let’s use AGEKDBRN as
our test variable.
• Click on “OK.”
Exercises for Independent Sample
T Test
• Use the independent sample t test to compare
the mean age (AGE) of respondents who believe
and do not believe in life after death
(POSTLIFE). Which group had the highest
mean age? Was the difference statistically
significant at the .05 level of significance?
• Compare the mean family income (INCOME06)
of men and women (SEX). Who had the higher
income? Was it statistically significant at the .05
level of significance?
Paired Samples T Test
• Paired samples are samples where the
composition of one sample determines the
composition of the other sample (e.g.,
sample of husbands and wives married to
each other).
• Click on Analyze/Compare Means/Paired
Samples T Test.
Paired Samples T Test (continued)
• Select your paired variables by clicking on the
first variable in the list on the left and then
clicking on the arrow. Then click on the second
variable and click on the arrow again. They
should now be in the “Paired Variables” box on
the right. Let’s use MAEDUC and PAEDUC as
our paired variables.
• Move these two paired variables to the “Paired
Variables” box.
• Click on “OK.”
Exercises for Paired Sample T Test
• Use the paired-sample t test to compare
mother’s socioeconomic status (MASEI) and
father’s socioeconomic status (PASEI). Who
has the highest mean socioeconomic status –
mothers or fathers? Was the difference
statistically significant?
• Compare the mean years of school completed
for respondents (EDUC) and their spouses
(SPEDUC). Who has the higher years of school
completed? Was the difference statistically
significant?
One-Way Analysis of Variance
• Now we want to compare means for more than
two groups.
• Click on Analyze/Compare Means/Means.
• Select the variable that defines your groups by
clicking on it and moving it to the “Independent
List” box. Do this for DEGREE.
• Select the variable that you want to use as your
comparison variable and move it to the
“Dependent List” box. Let’s use AGEKDBRN as
our comparison variable.
One-Way Analysis of Variance
(continued)
• Click on “Options” to open the “Means:
Options” box.
• Click in the “Anova table and eta” box to
select it and indicate that you want to do a
One-Way ANOVA.
• Click on “Continue” and on “OK.”
Exercises for One-Way ANOVA
• Use One-Way ANOVA to compare the mean years of
school completed (EDUC) of respondents who voted for
Bush, Kerry, and someone else (PRES04). Which group
had the most education and which had the least
education? Was the F-value statistically significant?
• Compare the number of hours watching television
(TVHOURS) for people of different levels of education
(DEGREE). Who watches more television – those with
more education or those with less education? Was the Fvalue statistically significant?
Dummy Variables
• Open the STATES.SAV file.
• Create new variable for whether state is in
South.
–
–
–
–
–
Click on Transform
Click on Compute Variable
Under Target Variable, type SOUTH.
Under Numeric Expression, type 0.
Click on OK.
Dummy Variables (continued)
–
–
–
–
–
–
–
–
Click on Transform
Click on Compute Variable
Under Numeric Expression, type 1.
Click on If
Click on Include if case satisfies condition.
In 1st box, type REGION = 3.
Click on Continue and OK.
When asked if you want to Change exiting
variable?, click on OK.
Dummy variables (continued)
Create new variable called WEST that is 1 if
REGION equals 4, 0 otherwise. Note: be sure
to click on Reset in the Compute Variable
dialog box before proceeding further.
Correlation and Regression
(see chs. 7 and 8 in text)
• Click on Analyze > Correlate > Bivariate.
• Select PID, IDEO, MARRIED, and SOUTH
and WEST
• Click on one-tailed and on OK.
Correlation and Regression
(continued)
• Click on Analyze > Regression > Linear.
• Select PID, as the dependent variable,
and IDEO, MARRIED, SOUTH and
WEST as independent variables.
• Click on OK.
Exercises for Correlation and
Regression
• Open the GSS06A file. Create a
correlation matrix among the following:
EDUC, MAEDUC, PAEDUC, PRESTG80,
and SEI.
• Open the STATES file. What explains
variation among states in propensity
toward charitable giving (CHARITY)?
Charts/Graphs
(see ch. 9 in text)
•
•
•
•
•
Pie charts
Bar charts
Histograms
Boxplots
Scatterplots
General Information About Graphs
• There are three ways to produce charts in
SPSS
– Chart Builder
– Legacy
• “Classical”
• Interactive
• We’ll be using the last of these
Simple Pie Charts
• Switch to the GSS06A data set.
• Select Graphs > Legacy Dialogs > Interactive
> Pie > Simple.
• Move DEGREE into first box on right.
• Move $PCT into second box on right.
• Click on OK.
Editing the Pie Chart
• Double click anywhere inside the pie chart to
open the Chart Editor.
• Click Options > Title, and add a title to your
chart.
• Click Elements > Show Data Labels to display
percents and data labels.
• Click on the slice you want to explode. Now
click Elements > Explode Slice.
Copying the Pie Chart
•
•
•
•
Close the Chart Editor
Select the pie chart by single clicking on it.
Click on Edit and then on Copy.
Go to your report in Word and click on Edit >
Paste Special > JPEG > OK.
Simple Bar Charts
• Select Graphs > Legacy Dialogs > Interactive
> Bar
• Move $PCT into first box on right.
• Move DEGREE into second box on right.
• Click on OK.
Clustered Bar Chart
• Select Graphs > Legacy Dialogs > Interactive
> Bar
• Move $PCT into first box on right.
• Move DEGREE into second box on right.
• Move SEX into third box on right.
• Click on OK.
Histogram
• Select Graphs > Legacy Dialogs > Interactive
> Histogram
• Move $PCT into first box on right.
• Move AGE into second box on right.
• In Histogram tab, check box for Normal curve.
• Click on OK.
Boxplot for Single Variables
• Open the STATES.SAV file.
• Select Graphs > Legacy Dialogs > Interactive
> Boxplot
• Move MEDIANHS into first box on right.
• Move STATE into last box on right.
• Click on OK.
Boxplot by Categories of a
Second Variable
• Select Graphs > Legacy Dialogs > Interactive
> Boxplot
• Move MEDIANHS into first box on right.
• Move REGION into second box on right.
• Move STATE into last box on right.
• Click on OK.
Scatterplots
• Select Graphs > Legacy Dialogs > Interactive
> Scatterplot.
• In Assign Variables tab:
–
–
–
–
move PID into 1st box.
move IDEO into 2nd box.
move REGION into 4th box.
move STATE into last box
• Click on OK.
Scatterplots (continued)
• In Fit tab:
– Under Method, select Regression.
• Click on OK.
Exercises for Graphs
• Using GSS06A.SAV:
– Create a pie chart and a bar chart for POLVIEWS.
– Create a histogram for SEI.
– Create a boxplot for SEI and then create separate
boxplots for males and females.
• Using STATES.SAV, create a scatterplot for
TRAFFIC and ENERGY.
• Try various ways of editing your graphs.
• Copy the graphs into Word.
Where do you go from here?
• Explore the help menu.
• Spend some time playing with SPSS.
• Try out different ways of analyzing your
data.
• Show them to others for suggestions.