Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE...

23
Introduction to SPSS Introduction to SPSS (For SPSS Version 16.0) (For SPSS Version 16.0) Eric Hamilton Eric Hamilton CSSCR CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH AND RESEARCH UNIVERSITY OF WASHINGTON UNIVERSITY OF WASHINGTON Fall, 2010 Fall, 2010

Transcript of Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE...

Page 1: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Introduction to SPSSIntroduction to SPSS(For SPSS Version 16.0)(For SPSS Version 16.0)

Eric HamiltonEric Hamilton

CSSCR CSSCR

CENTER FOR SOCIAL SCIENCE CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCHCOMPUTATION AND RESEARCH

UNIVERSITY OF WASHINGTONUNIVERSITY OF WASHINGTON

Fall, 2010Fall, 2010

Page 2: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Topics Covered in this Topics Covered in this Introductory CourseIntroductory Course

SPSS at a glance, basic structureSPSS at a glance, basic structure

Cleaning & reformatting your dataCleaning & reformatting your data

Descriptive statistics – frequencies, Descriptive statistics – frequencies, crosstabs, explore crosstabs, explore

Charts & graphs: histograms, legacy Charts & graphs: histograms, legacy charts, editing graphscharts, editing graphs

Resources for learning more about Resources for learning more about SPSSSPSS

Page 3: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

SPSS at a glanceSPSS at a glance

SPSS (Statistical Package for the Social SPSS (Statistical Package for the Social Sciences) was designed to offer a more Sciences) was designed to offer a more user-friendly data analysis presentation user-friendly data analysis presentation than other statistical software (e.g., S-than other statistical software (e.g., S-Plus, R, SAS). Plus, R, SAS).

The newest version of SPSS is called The newest version of SPSS is called “IBM SPSS Statistics 19”. IBM purchased “IBM SPSS Statistics 19”. IBM purchased SPSS in 2009. This tutorial refers to use SPSS in 2009. This tutorial refers to use of SPSS 16.0. There are some added of SPSS 16.0. There are some added functions in the new version, but for the functions in the new version, but for the most part, the usability is similar. most part, the usability is similar.

Page 4: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Opening SPSSOpening SPSS

Go to START, PROGRAMSGo to START, PROGRAMS

The computers in the CSSCR lab The computers in the CSSCR lab typically have SPSS on the typically have SPSS on the desktop. Select the red box that desktop. Select the red box that says SPSS on the top. says SPSS on the top.

Page 5: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Opening a data Opening a data file in SPSSfile in SPSS

Open the version of SPSS you’d Open the version of SPSS you’d like to work with.like to work with.

Select File>Open>Data. Select File>Open>Data.

Select the format of your data with Select the format of your data with the “Files of type” menu, then the “Files of type” menu, then locate, select, and open your data locate, select, and open your data file.file.

Page 6: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Basic structure of Basic structure of SPSSSPSS

There are multiple windows in SPSSThere are multiple windows in SPSSThe Data Editor Window – shows The Data Editor Window – shows data in two formsdata in two forms

Data viewData viewVariable viewVariable view

The Output Viewer Window – shows The Output Viewer Window – shows results of data analysisresults of data analysisThe Syntax Editor Window – shows The Syntax Editor Window – shows the syntax command script. This is the syntax command script. This is also where you can type your own also where you can type your own syntax commands and run them. syntax commands and run them.

Note: you must perform separate save procedures for Note: you must perform separate save procedures for the data editor (.sav), output viewer (.spv), and the data editor (.sav), output viewer (.spv), and syntax editor (.sps) windows.syntax editor (.sps) windows.

Page 7: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Data view vs. Data view vs. Variable viewVariable view

Data viewData viewRows are casesRows are cases

Columns are variables (generally speaking)Columns are variables (generally speaking)

Variable viewVariable viewRows define the variables Rows define the variables

Name, Type, Width, Decimals, Label, Values, Name, Type, Width, Decimals, Label, Values, Missing, Columns, Align, Measure.Missing, Columns, Align, Measure.

The The Measure Measure of variables in the dataset is important: of variables in the dataset is important: Scale “continuous” – age, weight, incomeScale “continuous” – age, weight, income

Nominal “names” – categories that cannot be ranked Nominal “names” – categories that cannot be ranked (ID number)(ID number)

Ordinal “ordered” – categories that can be ranked Ordinal “ordered” – categories that can be ranked (level of satisfaction)(level of satisfaction)

Page 8: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Data manipulation – select Data manipulation – select casescases

With the select cases With the select cases command, you can command, you can select specific cases select specific cases for analysisfor analysis

click DATAclick DATA

click SELECT CASESclick SELECT CASES

click IF CONDITION IS click IF CONDITION IS SATISFIEDSATISFIED

select the variable select the variable with which you’ll with which you’ll select casesselect cases

enter the logical enter the logical command to select command to select the cases you want to the cases you want to analyze.analyze.

Page 9: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Data manipulation – compute new Data manipulation – compute new variablevariable

Example: create a new variable from Example: create a new variable from already existing variablesalready existing variables

click TRANSFORMclick TRANSFORM

click Compute Variableclick Compute Variable

fill in the new target variable fill in the new target variable testscore_extestscore_ex

fill in numeric expression = fill in numeric expression = StTestScore + 3StTestScore + 3

create an IF statement by clicking on create an IF statement by clicking on the IF buttonthe IF button

click INCLUDE IF CASE SATISFIES click INCLUDE IF CASE SATISFIES CONDITION, and enter SCHOOL = CONDITION, and enter SCHOOL = LOCKE, then LOCKE, then click click OKOK

Hypothetically, this new variable testscore_ex would adjust scores for those students who were at Locke and took a modified version of the test.

Page 10: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Data manipulation – recode a Data manipulation – recode a variablevariable

Recoding allows a researcher to create a new Recoding allows a researcher to create a new variable with a different set of parametersvariable with a different set of parameters

click TRANSFORMclick TRANSFORM

click RECODE INTO DIFFERENT VARIABLEclick RECODE INTO DIFFERENT VARIABLE

move Grade over move Grade over to the rightto the right

create a name for create a name for the new variable: the new variable: Grade_num Grade_num

click Old and New click Old and New ValuesValues

Page 11: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Data manipulation – recode a Data manipulation – recode a variablevariable(contin.)(contin.)

Select and enter Select and enter data recode data recode modifications:modifications:

Enter an already Enter an already existing Old Value, existing Old Value, then enter its New then enter its New Value, and AddValue, and Add

or, or,

then click RANGE then click RANGE to create ranges to create ranges of old valuesof old values

click VALUE to click VALUE to create a new create a new value for that value for that range of old range of old valuesvalues

Page 12: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Cleaning your Cleaning your data: missing data: missing

datadataThere are two types of missing values in SPSS: system-missing and user-defined.

System-missing data is assigned by SPSS when a function cannot be performed.

For example,

dividing a number by zero. SPSS indicates that a value is system-missing by one period in the data cell.

Page 13: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Cleaning your Cleaning your data – missing data – missing

datadataUser-defined missing data are values that the User-defined missing data are values that the researcher can tell SPSS to recognize as missing. researcher can tell SPSS to recognize as missing. For example, 9999 is a common user-defined For example, 9999 is a common user-defined missing value. To define a variable’s user-defined missing value. To define a variable’s user-defined missing value…missing value…

Look at your variables in VARIABLE VIEWFind the column labeled MISSINGFind the variable that you would like to work with.Select that variable’s missing cell by clicking on the gray box in the right corner.click DISCRETE MISSING VALUESenter a specific value, such as 9999, to define this variable’s missing value

A range can also be used if, for example, you only want to use half of a scale.

Page 14: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Cleaning your data – missing Cleaning your data – missing data cont.data cont.

When you have missing data in your data set, When you have missing data in your data set, you can fill in the missing data with you can fill in the missing data with surrounding information so that the surrounding information so that the missingness does not impede your analysis. missingness does not impede your analysis.

click TRANSFORM click REPLACE MISSING

VALUES select the variable with missing

values and move it to the right using the arrow

SPSS will rename and create a new variable with your filled-in data.

click METHOD to select what type of method you would like SPSS to use when replacing missing values.

click OK and view your new data in data view

Page 15: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Descriptive Descriptive Statistics: Statistics:

FrequenciesFrequenciesLets say we are Lets say we are interested in learning interested in learning more about the more about the characteristics of the characteristics of the schools (schools (SchoolSchool) in ) in the example dataset.the example dataset.

Click ANALYZEClick ANALYZE

Click DESCRIPTIVE Click DESCRIPTIVE STATISTICSSTATISTICS

Click FREQUENCIESClick FREQUENCIES

Choose Choose School School from from the list.the list.

Page 16: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Descriptive Descriptive Statistics: ExploreStatistics: Explore

You can also generate You can also generate descriptive statistics on descriptive statistics on multiple variables at once.multiple variables at once.

Click ANALYZEClick ANALYZE

Click DESCRIPTIVE Click DESCRIPTIVE STATISTICSSTATISTICS

Click EXPLOREClick EXPLORE

Move the variables you’re Move the variables you’re interested in over with the interested in over with the arrowarrow

Click Statistics/Plots/Options to choose which statistics and forms of output you are interested in seeing.

Page 17: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Descriptive Descriptive Statistics: CrosstabsStatistics: Crosstabs

To generate descriptive To generate descriptive statistics to look at statistics to look at frequencies across multiple frequencies across multiple variables:variables:

Click ANALYZEClick ANALYZE

Click DESCRIPTIVE Click DESCRIPTIVE STATISTICSSTATISTICS

Click CROSSTABSClick CROSSTABS

Move the variables you’re Move the variables you’re interested in over with the interested in over with the arrowarrow

Select the options you’d like Select the options you’d like to apply to the Crosstabs to apply to the Crosstabs output (Statistics, etc.)output (Statistics, etc.)

Click OK Click OK

Page 18: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Graphing DataGraphing DataGraphs can be Graphs can be generated and generated and formatted easily in formatted easily in SPSS. SPSS.

Click GRAPHClick GRAPH

Click LEGACY DIALOGSClick LEGACY DIALOGS

Click HISTOGRAMClick HISTOGRAM

Put Put School School on the X axis. on the X axis.

Click ELEMENT PROPERTIES. Click ELEMENT PROPERTIES. Check the box labeled DISPLAY Check the box labeled DISPLAY NORMAL CURVE. This will NORMAL CURVE. This will impose a normal curve onto impose a normal curve onto your graph. You can also your graph. You can also change the style of your graph change the style of your graph in this element properties in this element properties window. window.

These graphs can be copied and These graphs can be copied and pasted into other programs, pasted into other programs, such as Word and Excel. such as Word and Excel.

Page 19: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Graphing Graphing ContinuedContinuedGraphs can also be Graphs can also be

gererated through the gererated through the Frequencies Frequencies command: command:

Click ANALYZEClick ANALYZE

Click DESCRIPTIVE Click DESCRIPTIVE STATISTICSSTATISTICS

Click FREQUENCIESClick FREQUENCIES

Click Click SchoolSchool

Click CHARTClick CHART

Click BAR CHARTClick BAR CHART

Click PERCENTAGESClick PERCENTAGES

Page 20: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Formatting Formatting GraphsGraphs

You can easily make You can easily make your graphs clearer your graphs clearer and more professional-and more professional-looking with SPSS looking with SPSS

Double click on the graph Double click on the graph or chart in the output or chart in the output window, this opens the window, this opens the chart editor. chart editor.

Double click on the part of Double click on the part of the chart you want to edit. the chart you want to edit.

Select and adjust the Select and adjust the various properties until various properties until your chart appears as you your chart appears as you wish wish

You can adjust the scale, You can adjust the scale, labels, text, etc.labels, text, etc.

Page 21: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

What we have What we have covered:covered:

SPSS at a glance: basic SPSS at a glance: basic structure of SPSSstructure of SPSS

Cleaning & transforming your Cleaning & transforming your data – select cases, sorting, data – select cases, sorting, recoding, transformingrecoding, transforming

Descriptive statistics – Descriptive statistics – frequencies, crosstabs, explore frequencies, crosstabs, explore

Charts & graphs: legacy charts, Charts & graphs: legacy charts, editing graphsediting graphs

Page 22: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Other ResourcesOther ResourcesThere are many resources online to help you There are many resources online to help you learn SPSS (tutorials, blogs, etc.)learn SPSS (tutorials, blogs, etc.)

http://www.stat.tamu.edu/spss.phphttp://www.stat.tamu.edu/spss.phphttp://www.ats.ucla.edu/stat/SPSS/http://www.ats.ucla.edu/stat/SPSS/http://www.lrz.de/~wlm/wlmspss.htmhttp://www.lrz.de/~wlm/wlmspss.htm

CSSCR has a Quicktime SPSS class and SPSS CSSCR has a Quicktime SPSS class and SPSS handouts on the department website.handouts on the department website.

CSSCR offers classes on SPSS frequently– CSSCR offers classes on SPSS frequently– come back for the SPSS Beyond the Basics come back for the SPSS Beyond the Basics class, or schedule an appt. with on of the class, or schedule an appt. with on of the CSSCR consultants.CSSCR consultants.

Page 23: Introduction to SPSS (For SPSS Version 16.0) Eric Hamilton CSSCR CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH UNIVERSITY OF WASHINGTON Fall, 2010.

Introduction to SPSSIntroduction to SPSS(For SPSS Version 16.0)(For SPSS Version 16.0)

Eric HamiltonEric Hamilton

CSSCR CSSCR

CENTER FOR SOCIAL SCIENCE CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCHCOMPUTATION AND RESEARCH

UNIVERSITY OF WASHINGTONUNIVERSITY OF WASHINGTON

Fall, 2010Fall, 2010