24
CENTER FOR SOCIAL SCIENCE CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH COMPUTATION AND RESEARCH (CSSCR) (CSSCR) UNIVERSITY OF WASHINGTON UNIVERSITY OF WASHINGTON Fall Quarter, 2012 Fall Quarter, 2012 Prepared by Eric Hamilton Prepared by Eric Hamilton INTRODUCTION TO SPSS INTRODUCTION TO SPSS (AND TIPS AND TRICKS) (AND TIPS AND TRICKS)

Introduction to SPSS (and tips and tricks)

  • Upload
    mulan

  • View
    43

  • Download
    3

Embed Size (px)

DESCRIPTION

Introduction to SPSS (and tips and tricks). CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH ( CSSCR) UNIVERSITY OF WASHINGTON Fall Quarter, 2012 Prepared by Eric Hamilton. Topics Covered in this Introductory Course. -SPSS basic structure & layout -Importing data - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to SPSS (and tips and tricks)

CENTER FOR SOCIAL SCIENCE CENTER FOR SOCIAL SCIENCE

COMPUTATION AND RESEARCHCOMPUTATION AND RESEARCH

(CSSCR)(CSSCR)

UNIVERSITY OF WASHINGTONUNIVERSITY OF WASHINGTON

Fall Quarter, 2012Fall Quarter, 2012

Prepared by Eric HamiltonPrepared by Eric Hamilton

INTRODUCTION TO SPSSINTRODUCTION TO SPSS(AND TIPS AND TRICKS)(AND TIPS AND TRICKS)

Page 2: Introduction to SPSS (and tips and tricks)

-SPSS basic structure & layout

-Importing data

-GUI vs. Syntax use

-Managing and recoding your data

-Descriptive statistics & intro analysis– frequencies, explore, crosstabs, correlations

-Tips and tricks for data management and analysis

-Resources for learning more about SPSS

TOPICS COVERED IN THIS INTRODUCTORY COURSE

Page 3: Introduction to SPSS (and tips and tricks)

SPSS (Statistical Package for the Social Sciences) offers a user-friendly data analysis platform.

Go to START, PROGRAMS, and click on the SPSS version of your choice

or

The computers in the CSSCR labs typically have SPSS on the desktop. Double click on the icon of the version that you want to use.

SPSS AT A GLANCESPSS AT A GLANCE

Page 4: Introduction to SPSS (and tips and tricks)

SPSS has three windows for working with data:

The Data Editor Window (.sav)shows data in two forms:Data viewVariable view

The Output Viewer Window (.spv)shows results of data analysis

The Syntax Editor Window (.sps)shows the syntax command script.

This is also where you can type and run your own syntax commands.

BASIC STRUCTURE OF SPSSBASIC STRUCTURE OF SPSS

Note: Perform separate save procedures for the data editor (.sav), output viewer (.spv), and syntax editor (.sps) windows.Remember to save your work frequently, under names that will have meaning for you in the future.

Page 5: Introduction to SPSS (and tips and tricks)

Data viewRows are cases (participants in the study)Columns are variablesYou can toggle between data values and labels

Variable viewRows define the variable characteristics:

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

The Measure of variables in the dataset is important: Scale = “continuous” – e.g., age, weight, income Ordinal = “ordered” – categories that can be ranked

(e.g., level of satisfaction or agreement, Likert-type scales) Nominal = “names” – categories that cannot be

ranked (e.g., ID number)

THE EDITOR WINDOW:THE EDITOR WINDOW:DATA VIEW VS. VARIABLE VIEWDATA VIEW VS. VARIABLE VIEW

Page 6: Introduction to SPSS (and tips and tricks)

-You can work with the Wizard, or click Cancel, and-Select File > Open > Data.-Locate the folder that contains your data file. -Select the format of your incoming data with the “Files of type”

button-locate and select your data file, then click Open-a window will appear, and ask whether the first row in the data

set represents variable names (Yes), click OK-Check to see that the data appear as in your original data set

*For the examples covered in this presentation, select “Files of type: Excel”, then open “CSSCR_Aut12_SPSSintro.xls”

IMPORTING A DATA FILEIMPORTING A DATA FILE

Page 7: Introduction to SPSS (and tips and tricks)

The GUI (graphical user-interface, “gooey”) allows you to interact with SPSS via images and buttons, rather than text. You can “draw-down” commands from menus at the top of the window.

The Syntax window executes commands that you enter as text.

Open a syntax window (File > Open > Syntax), and type or paste text to call functions.

Select specific sections of text and click “Run Selection” to execute commands.

GUI VS. SYNTAXGUI VS. SYNTAX

Page 8: Introduction to SPSS (and tips and tricks)

With the select cases command, you can select subsets of cases for analysis

DATA > SELECT CASES > IF CONDITION IS SATISFIED

-select the variable of interst -enter the logical command to select

the cases you want to analyzee.g., “Select Cases IF Grade = 12”

SELECTING CASESSELECTING CASES

Page 9: Introduction to SPSS (and tips and tricks)

Example: create a new, transformed variable from an already existing variable

-click Transform > Compute Variable-Assign the new “Target Variable” (this will be

attached at the end of the variables list)Let’s call it: TestScore_Ex-fill in the numeric expression:

TestScore = SQRT(TestScore)To compute, for example, only the 12th grade

scores, you can create an If-Then statement by clicking on the IF button-click INCLUDE IF CASE SATISFIES CONDITION, and enter (e.g.) Grade = 12, then click OK

COMPUTE VARIABLECOMPUTE VARIABLE

Page 10: Introduction to SPSS (and tips and tricks)

-if you need to find how to write the function, there is a list of functions on the right

This procedure will create a new variable at the end of the variable list that is the means of the variables that you chose to include in the computation.

-again, you can select a subset of cases by by clicking on the IF button

COMPUTE VARIABLE (CONTIN.) COMPUTE VARIABLE (CONTIN.)

Page 11: Introduction to SPSS (and tips and tricks)

Recoding allows a researcher to create a new variable with, for example, a different set of parameters-Decide which Variable(s) you want to recodeTRANSFORM > RECODE INTO DIFFERENT VARIABLE-move variable of interest to the right-create a name for the new variable-click Old and New Values

RECODING VARIABLESRECODING VARIABLES

Page 12: Introduction to SPSS (and tips and tricks)

-Select and enter the appropriate data recode modifications:

-Enter an already existing Old Value, then enter its New Value, and click Add(note: these must be typed exactly as they appear in the data view. Copy/paste is ok.)

-Alternatively, click RANGE to create ranges of old values

RECODING VARIABLES RECODING VARIABLES (CONTIN.)(CONTIN.)

-If you’ve recoded all the values you want changed, click on “Copy old value(s)”

-Click OK and check that your new values were created correctly.

Page 13: Introduction to SPSS (and tips and tricks)

After recoding your variables, you may want to record the values assigned to each category of the variables. You can note in SPSS what your numeric values stand for in the “Value Labels” area.

-Select the Values drop-down, and record the values and labels for your range of new data.

-If you forget how you recoded your data, your labels should be available in your output (.spo) file.

THE VARIABLE VIEW:THE VARIABLE VIEW:EDITING VALUE LABELSEDITING VALUE LABELS

Page 14: Introduction to SPSS (and tips and tricks)

THE VARIABLE VIEW:THE VARIABLE VIEW:ACCOUNTING FOR ACCOUNTING FOR MISSING DATAMISSING DATA

Many data sets have a few, or a lot, of missing data points.

SPSS lets you account for missing data in two ways: system-missing (indicated by one period in the data cell); and user-defined (specified by you, User).

Click on a variable’s “missing” drop-down, and enter the specific, discrete values (998, 999, etc.) that will represent missing data in your data set.

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

Also, system-missing data is assigned by SPSS when a function cannot be performed. (e.g., dividing a number by zero)

Page 15: Introduction to SPSS (and tips and tricks)

-Select desired statistical output (Central Tendency, Dispersion, etc.) from the Statistics button.

-Select the type of chart you’d like SPSS to produce (e.g., Histogram) with the Charts button.

-Click OK, or Paste (then Run), and review the output.

DESCRIPTIVE STATISTICS: DESCRIPTIVE STATISTICS: FREQUENCIESFREQUENCIES

-Lets say we want output on the number of cases (the frequencies) subjected to each type of curriculum in the example dataset.

Click ANALYZE > DESCRIPTIVE STATISTICS > FREQUENCIES

-Choose Curriculum from the list.

Page 16: Introduction to SPSS (and tips and tricks)

You can also generate a variety of descriptive statistics on multiple variables at once. SPSS can produce a lot of useful statistical output with the Explore command.

Click ANALYZE > DESCRIPTIVE STATISTICS > EXPLORE

-Decide which relationships, independent variables (Factors) to outcomes (Dependent), you’d like SPSS to produce, and move them over with the arrows

DESCRIPTIVE STATISTICS: DESCRIPTIVE STATISTICS: EXPLOREEXPLORE

-Click Statistics/Plots/Options to choose which statistics and forms of output you are interested in producing, then click OK or Paste to Syntax.

-Review your output.

Page 17: Introduction to SPSS (and tips and tricks)

To look at frequencies of data nested across multiple variables (and run a Chi-Square test):

ANALYZE > DESCRIPTIVE STATISTICS > CROSSTABS

-Move the variables of interest over with the arrows

-Select the options you would like to apply to the Crosstabs output (Statistics, etc.)

-Click OK (or PASTE to syntax)

DESCRIPTIVE STATISTICS: DESCRIPTIVE STATISTICS: CROSSTABSCROSSTABS

Page 18: Introduction to SPSS (and tips and tricks)

This measures the dependence between two variables, by the Pearson product-moment correlation coefficient, or "Pearson's correlation”

-ANALYZE > CORRELATE > BIVARIATE-Move the variables of interest over with

the arrow-Select the options you would like to apply

to the correlation analysis (Statistics, etc.)

-Select Two-tailed significance test, if the direction of the relationship between your variables is unknown

-Click OK (or PASTE to syntax)

CORRELATION ANALYSISCORRELATION ANALYSIS

Page 19: Introduction to SPSS (and tips and tricks)

After all the data cleaning and various forms of analyses you’ve run, you want to be sure to save all of your work, in an organized fashion (and regularly)!

-Give your data files names that are sufficiently descriptive of what you are working on, and that you will recognize when you come back to the data at some time in the future.

-Backup your data (save in multiple locations: memory sticks, computers, ext. hard drives, etc.), in case one source should become lost or corrupted.

SAVING YOUR WORKSAVING YOUR WORK

Page 20: Introduction to SPSS (and tips and tricks)

Remember that each file format (.sav, .spv, .sps) should be saved as a uniquely-identified element of your data cleaning/analyses.

It may be useful, during the process of data cleaning and analyzing, to save your work with ascending file names.

for example: School1_datacleaning_A1.savSchool1_datacleaning_A2.sav

…School1_datacleaning_B1.sav

This way, you can delete older, unneeded files, and you have a backup if something goes wrong (the program stalls, earthquake, etc.).

SAVING YOUR WORK (CONTIN.)SAVING YOUR WORK (CONTIN.)

Page 21: Introduction to SPSS (and tips and tricks)

Keep Variable Names short. Use Labels as a more detailed description of your data

Toggle between data values and labels: Double-click margins to move between Data and Variable ViewsRight-click in drawdown menus (e.g., transform operations) to

toggle between values/labelsMoving variables within the list in Variable View

“clearing the cursor” Click-and-hold, move right to move a new variable to the top of the

fileUtilities option: Data File Comments tool (very useful!). This

function auto-dates your entries, and remains in files saved from previous files

Other ideas?

TIPS AND TRICKSFOR USING SPSS

Page 22: Introduction to SPSS (and tips and tricks)

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

There are many resources online to help you learn SPSS (tutorials, blogs, etc.). Here are a few examples: http://www.stat.tamu.edu/spss.php http://www.ats.ucla.edu/stat/SPSS/ http://www.lrz.de/~wlm/wlmspss.htm

CSSCR offers classes on SPSS frequently– come back for an Intermediate SPSS class or call us to schedule an appointment with one of the CSSCR consultants!

HELPFUL RESOURCESHELPFUL RESOURCES

Page 23: Introduction to SPSS (and tips and tricks)

-SPSS basic structure & layout

-GUI vs. syntax use

-Importing data

-Managing and recoding your data

-Descriptive statistics – frequencies, explore, crosstabs, correlations

-Tips and tricks for data management and analysis

-Resources for learning more about SPSS

WHAT WE HAVE COVERED:WHAT WE HAVE COVERED:

Page 24: Introduction to SPSS (and tips and tricks)

Thanks!Thanks!

CENTER FOR SOCIAL SCIENCE CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH (CSSCR)COMPUTATION AND RESEARCH (CSSCR)

UNIVERSITY OF WASHINGTONUNIVERSITY OF WASHINGTONFall Quarter, 2012Fall Quarter, 2012

Prepared by Eric HamiltonPrepared by Eric Hamilton

INTRODUCTION TO SPSSINTRODUCTION TO SPSS(AND TIPS AND TRICKS)(AND TIPS AND TRICKS)