Introduction to SPSS Module II - PowerPoint PPT Presentation

1 / 66
About This Presentation
Title:

Introduction to SPSS Module II

Description:

... value of = 1 grouping variables. Can specify = 8 grouping variables ... Use the Split File Function on Race2 to separate race groups. Transformation Functions ... – PowerPoint PPT presentation

Number of Views:97
Avg rating:3.0/5.0
Slides: 67
Provided by: ei02
Category:

less

Transcript and Presenter's Notes

Title: Introduction to SPSS Module II


1
Introduction to SPSSModule II
  • Hsin-Hui Lin, Ph.D.
  • Paul M. Montebello, Ph.D.

Policy Planning Research Division Department of
Childrens Services Tennessee State
2
Contents
  • Review Module 1
  • File Manipulation Functions
  • Data Transformation Functions
  • Working with Command Syntax

3
Review of Module I
  • SPSS Program Flow
  • Data ? Syntax ? Output
  • Using Data Files in SPSS
  • Importing a Fixed-length File (.dbf/.xls)
  • Importing a Fixed-length Text File (.txt)
  • Importing a Variable-length Text File

4
Review of Module I
  • Working with Variables in SPSS
  • Variable Names
  • Variable Types
  • Variable Labels
  • Value Labels
  • Missing Values
  • Levels of Measurement
  • Using the SPSS Data Editor

5
File Manipulation Functions
  • SPSS File Manipulation Functions
  • Sort Cases
  • Merge Files
  • Select Cases
  • Split File
  • Restructure Data

6
Sort Cases
  • Sorts on Sorting Variables gt 1
  • Ascending or Descending Order
  • Multi-sort SPSS Sorts by Each Variable w/in
    Categories of Prior Variable
  • For String Variables, Y Precedes y

7
Sort Cases
8
Sort Cases
9
Merge Files
  • Merge File Methods
  • Merge files with the same variables, but
    different cases
  • Merge files with the same cases, but different
    variables

10
Add Cases
11
Add Cases
12
Add Cases
13
Add Cases Workshop
  • Merge cases from Cohort2 with Cohort1
  • Get Cohort2.sav from C\DCS_SPSS folder
  • Sort ID and save the file
  • Get Cohort1.sav from C\DCS_SPSS folder
  • Sort ID and save the file
  • Add cases in Cohort2.sav to Cohort1.sav
  • Save the file to Cohort12.sav

14
Add Variables
15
Add Variables
16
Add Variables
17
Add Variables
18
Add Variables Workshop
  • Merge Variables from Custody1.sav with
    Clientall.sav

19
Select Cases
  • Select Cases Creates Case Subgroups Based on
    Specified Criteria
  • Variable values and ranges
  • Date and time ranges
  • Case numbers
  • Arithmetic expressions
  • Logical expressions
  • Functions

20
Select Cases
21
Select Cases
22
Select Cases Workshop
  • Use Casestudy.sav
  • Use the Select Cases Function on the Following
    Criteria
  • Race21
  • Gender11

23
Split File
  • Splits File into segments based on the value of
    gt 1 grouping variables
  • Can specify lt 8 grouping variables
  • Cases should be sorted by values of the grouping
    variables in the same order that variables are
    listed in the group based on list.

24
Split File
25
Split File
26
Split File Workshop
  • Use Casestudy.sav
  • Use the Split File Function on Race2 to separate
    race groups

27
Transformation Functions
  • Automatic Recode
  • Recode Values
  • Compute Variable
  • Time Series Transformation
  • Rank Cases
  • Categorize Variables

28
Automatic Recode
  • Modifies Data Values by Recoding
  • Used to combine/collapse categories
  • Two Recode Options
  • Recode into the same variable
  • Recode into a new variable

29
Automatic Recode
30
Automatic Recode
31
Automatic Recode
32
Recode Values
  • Recode
  • Single values
  • Range of values
  • Missing values
  • Recodes Old Value ? New Value

33
Recode Values
34
Recode Values
35
Recode Values
36
Recode Values Workshop
  • Use Actcase.sav
  • Recode RACE ? RACE2
  • 1 White
  • 2 Black
  • 3 Multiple Races
  • 4 Other
  • 9 Missing
  • Recode HISP ? HISP2
  • 1 Yes
  • 2 No
  • 9 Missing

37
Compute Variable
  • Compute converts values based on the value of
    other variables
  • Compute values for numerics or strings
  • Create new or replace existing variables
  • Compute values using logical conditions
  • Can utilize 70 built-in functions

38
Compute Variables
39
Compute Dates
  • Length of Stay BASEDATE - INTDT
  • BASEDATE Value YRMODA (yr,mo,dy)
  • INTDT Value YRMODA (yr,mo,dy)

40
Compute Workshop
  • Use Casestudy.sav
  • Use the variable of CSIND to Calculate the Number
    of Days in Custody (LOS)
  • BASEDATE 11/15/2002

41
Rank Cases
  • Rank Cases Creates New Variables Containing
    Ranks, Scores or Percentiles
  • Can rank cases in either a/d order
  • Can organize rank by grouping variables
  • Offers several ranking types
  • Offers several methods for ranking ties

42
Rank Cases
43
Rank Cases
44
Rank Cases
45
Categorize Variables
  • Converts Continuous Numeric Data to a Discrete
    Number of Categories
  • Categories are based on percentile groups
  • Each group contains roughly the same N

46
Categorize Variables
47
Restructure Data
  • Restructure Data Replaces the Current File with a
    New Restructured File.
  • Three restructuring methods
  • Restructure selected variables into cases
  • Restructure selected cases into variables
  • Transpose all data

48
Restructure Rows to Columns
  • In Variable View Change the Format of CNT from
    F2.0 to F4.2

49
Restructure Rows to Columns
50
Restructure Rows to Columns
51
Restructure Rows to Columns
52
Restructure Rows to Columns
53
Restructure Rows to Columns
54
Restructure Rows to Columns
55
Restructure Rows to Columns
56
Restructure Workshop
  • Restructure Data File
  • Get F2FTemp.sav from C\DCS_SPSS folder
  • Restructure data file from children with multiple
    rows of custody episode to single row with
    multiple columns.

57
Working with Command Syntax
  • Command Syntax Rules
  • Creating Syntax from Dialog Boxes
  • Running Command Syntax

58
Command Syntax Rules
  • Every Command Must Begin On New Line
  • Every Command Must End With a Period
  • Slashes Separate Most Subcommands
  • Command Must Include Full Variable Names
  • Text Within Apostrophes or Quotation Marks Must
    Fit On a Single Line

59
Command Syntax Rules
  • Command Lines Must Be lt 80 Characters
  • Command Lines Must Use Periods for Decimals
  • Do Not Use Variable Names That End With Periods

60
Command Syntax Rules
61
Creating Syntax from Dialog
Click Paste to enter syntax from a dialog box to
a syntax window
62
Creating Syntax from Dialog
63
Running Command Syntax
  • Highlight Command in Syntax Window
  • Click Run on Syntax Window Toolbar
  • Select Choice(s) from Run Menu

64
Running Command Syntax
  • All
  • Runs all commands in the syntax window.
  • Selection
  • Runs the currently selected command(s) only.
  • Current
  • Runs command where the cursor is currently
    located.
  • To End
  • Runs all commands from the cursors current
    location to the end of the command syntax

65
Running Command Syntax
66
Command Syntax Workshop
  • Open the Syntax File
  • Custody_Pattern.sps
  • Run the Syntax by Section
  • Review the Output File
  • Debug the Syntax Command File
Write a Comment
User Comments (0)
About PowerShow.com