A Simple Guide to Using SPSS © for Windows By: Julia Hartman

Preview:

Citation preview

A Simple Guide toUsing SPSS© for Windows

By: Julia Hartman    

2

Using SPSS© for Windows

• Introduction• Data procedures• Statistical procedures• Syntax files• Editing output

3

Introduction

4

Steps for Analyzing Data

• Enter the data• Select the procedure and options• Select the variables• Run the procedure• Examine the output

5

Common Operations - Menu Options

• In the menu, click Statistics

• Choose Summarize

• Click Frequencies

6

Common Operations - Variables Dialog BoxThis type of dialog box is used for many procedures.

Variables are selected from the list on the left.

Click the arrowto move them to theappropriate box on the right.

7

Using SPSS© for Windows -Data Procedures

• Ways to Enter Data• Entering Data Directly

– Defining variables– Entering data

• Viewing Data • Recoding Variables• Computing New Variables• Selecting Cases

8

Ways to Enter the Data

• SPSS datafile

• Import data– Database file– Spreadsheet file– ASCII text file

• Enter data directly with Data Editor

9

Entering Data Directly-Define the Variables

10

Entering Data Directly-Define the Variable

• Name• Type and size• Labels• Missing values

11

Define the Variable - Name

• Name the variable– No more than 8

characters– Each name unique– Must begin with a

letter– Certain characters

not allowed– Not case sensitive

12

Define the Variable - Type

• Define the variable type.

• Define the variable width.

• Define the number of decimal places.

13

Define the Variable - Labels

• Labels will be displayed in the output.

• Variable Label– can be more descriptive

than variable name

• Value Labels– useful for files that use numeric

codes

14

Define the Variable - Missing Values

• Missing values are used to define user-specified missing information.– No response

– Refused to answer

– Data entry mistakes

15

Define the Variable - Column Format

Column Format is used to define column width

and alignment in theData Editor window

16

Entering Data Directly

• Each row is a case(e.g., survey form).

• Enter the value for each variable.

• Press <Tab> key or right arrow key to move to next variable.

17

Entering Data Directly

• Leave blank or use user-defined missing value if no answer.

• Press <Enter> key to move to next case.

18

Change the View - Value LabelsData entered as numeric codes can be displayed as value labels.

• In the menu, click View

• Click Value Labels

19

Recode Procedure

Recode is used to• to change the values of

an existing variable• to create a new

variable based on the values an existing variable

20

Recode into New Variable

• In the menu, click Transform.

• Select Recode.• Click

Into Different Variable(s)

21

Recode into New Variable

• Select and move variable(s) over.

• Name and label new variable.

• Click Old and New Values

22

Recode into New Variable

For each value of the existing variable

• Repeat for each value or range of values

• Click Continue

• Enter the old value• Enter the new value• Click Add

23

Recode into New Variable

• Click Change

• Click OK

24

Define Labels for New Variable

• In the Data menu, click Define Variable.

• Click Labels.

• Enter value labels for the new variable.

• Click Continue.

25

Compute Procedure

Compute is used to create a new variable.

• In the menu, click Transform.

• Click Compute.

26

Compute Procedure

• Name the newvariable.

• Click Type&Label to define the characteristics of the new variable.

27

Compute Procedure

• Label the newvariable.

• Enter the variable type.

28

Compute Procedure

• Enter the numeric expression thatwill determine the values of the new variable.

• Click OK.

29

Select Cases

For a subset of the datafile, use Select Cases.

• In the menu, click Data.• Click

Select Cases...

30

Select Cases - Alcohol drinkers only

To select only those cases which meet certain criteria, choose the If option.

31

Select Cases - Alcohol drinkers only

• Enter the expression thatwill determine which variables will be selected.

• Click Continue.

32

Select Cases - Alcohol drinkers only

When you’ve finished specifying selection criteria, click OK.

33

Using SPSS© for Windows -Statistical Procedures• Summarizing Data

– Frequencies– Crosstabs (Chi Square)

• Comparing Means– T-Tests– One-Way Analysis of Variance

• Nonparametric Tests– Wilcoxon Signed Ranks– Mann-Whitney U– Kruskal-Wallis

34

Frequencies

• In the menu, click Statistics

• Choose Summarize

• Click Frequencies

35

Frequencies

• Select and move the variables.

• Click Statistics.

36

Frequencies

• Choose the appropriate statistics.

• Click Continue.

37

Frequencies - Charts

For histograms or other charts, click Charts.

38

Frequencies

Choose the type of chart and click Continue

39

Frequencies

To select the format of the table(s), click Format.

40

Frequencies

Choose the format and click

Continue

41

Frequencies

Click OK to run the Frequencies

procedure.

42

Frequencies - Format optionOrganize Output by Variables

43

Frequencies - Format OptionCompare Variables

44

Frequencies - Distribution TableApgar 1 minute score

8 1.2 1.9 1.9

4 .6 .9 2.8

2 .3 .5 3.3

3 .5 .7 4.0

11 1.7 2.6 6.6

9 1.4 2.1 8.7

13 2.0 3.1 11.8

38 5.7 9.0 20.8

170 25.6 40.1 60.8

145 21.8 34.2 95.0

21 3.2 5.0 100.0

424 63.9 100.0

240 36.1

664 100.0

0

1

2

3

4

5

6

7

8

9

10

Total

Valid

SystemMissing

Total

Frequency PercentValid

PercentCumulative

Percent

45

Frequencies - Histogram

Apgar 1 minute score

10.08.06.04.02.00.0

Apgar 1 minute scoreF

req

ue

ncy

300

200

100

0

Std. Dev = 1.83

Mean = 7.8

N = 424.00

46

Crosstabs

• In the menu, click on Statistics

• Choose Summarize

• Click Crosstabs

47

Crosstabs• Move the outcome

variable(s) to the Row(s) box.

• Move the predictor variable(s) to the Column(s) box.

• Click Statistics.

48

Crosstabs

• Select the appropriate statistics.

• Click Continue.

49

Crosstabs

To select the counts, percentages, and residuals to be displayed in each cell, click Cells.

50

Crosstabs

• Select the information to be displayed in each cell.

• Click Continue.

51

Crosstabs

To run the Crosstabs procedure, click OK.

52

Crosstabs - Output

Case Processing Summary

45

95.7%

2

4.3%

47

100.0%

N

Percent

N

Percent

N

Percent

CasesValid

Missing

Total

Birthweight category *Smokes cigarettes

53

Crosstabs - OutputBirthweight category * Smokes cigarettes Crosstabulation

0 8 8

3.2 4.8 8.0

.0% 100.0% 100.0%

.0% 29.6% 17.8%

.0% 17.8% 17.8%

18 19 37

14.8 22.2 37.0

48.6% 51.4% 100.0%

100.0% 70.4% 82.2%

40.0% 42.2% 82.2%

18 27 45

18.0 27.0 45.0

40.0% 60.0% 100.0%

100.0% 100.0% 100.0%

40.0% 60.0% 100.0%

Count

Expected Count

% within Birthweightcategory

% within Smokescigarettes

% of Total

Count

Expected Count

% within Birthweightcategory

% within Smokescigarettes

% of Total

Count

Expected Count

% within Birthweightcategory

% within Smokescigarettes

% of Total

Low birthweight

Normal birthweight

Birthweightcategory

Total

no yes

Smokes cigarettes

Total

54

Independent Samples T-Test

• In the menu, click Statistics.

• Choose Compare Means.

• Click Independent Samples T-Test.

55

Independent Samples T-Test

• Select and move– Test Variable(s)

– Grouping Variable

• Click Define Groups.

56

Independent Samples T-Test

• Enter the values for the groups.

• Click Continue.

57

Independent Samples T-Test

Click OK to run the procedure.

58

Independent Samples T-Test - Output

Group Statistics

14 8.14 .95 .25

20 6.70 2.98 .67

Smokes cigarettes?no

yes

Apgar 1 minute scoreN Mean

Std.Deviation

Std. ErrorMean

Independent Samples Test

11.107 .002 1.746 32 .090 1.44 .83 -.24 3.13

2.026 24.180 .054 1.44 .71 -2.61E-02 2.91

Equal variancesassumed

Equal variances notassumed

Apgar 1 minute scoreF Sig.

Levene's Test forEquality of Variances

t dfSig.

(2-tailed)Mean

DifferenceStd. ErrorDifference Lower Upper

95% ConfidenceInterval of the

Difference

t-test for Equality of Means

59

One-Way Analysis of Variance

• In the menu, click on Statistics.

• Choose Compare Means.

• Click One-Way Analysis of Variance.

60

One-Way Analysis of Variance

• Move the dependent variable(s) to the Dependent List box.

• Move the grouping variable(s) to the Factor box.

• For comparison tests, click Post Hoc.

61

One-Way Analysis of Variance

• Select the appropriate Post Hoc comparisons.

• Click Continue.

62

One-Way Analysis of Variance

Click Options for• Descriptive statistics• Homogeneity of

variance• Mean plots• Missing values options

63

One-Way Analysis of Variance

Make appropriate selections, then click

Continue.

64

One-Way Analysis of Variance

To run the One-way ANOVA

procedure, click OK.

65

Test of Homogeneity of Variances

BTWT

1.384 3 647 .246

LeveneStatistic df1 df2 Sig.

One-Way Analysis of Variance - Output

Descriptives

BTWT

90 2888.72 599.25 63.17 2763.21 3014.23 670 3856

254 3031.24 602.39 37.80 2956.80 3105.68 706 4820

84 3050.98 632.61 69.02 2913.69 3188.26 506 4224

223 3264.89 525.97 35.22 3195.48 3334.30 1049 4734

651 3094.12 594.67 23.31 3048.36 3139.89 506 4820

Underweight

Normal

Overweight

Obese

Total

N MeanStd.

Deviation Std. ErrorLowerBound

UpperBound

95% Confidence Intervalfor Mean

Minimum Maximum

66

ANOVA

BTWT

11460978 3 3820325.9 11.318 .000

2.18E+08 647 337556.868

2.30E+08 650

Between Groups

Within Groups

Total

Sum ofSquares df

MeanSquare F Sig.

One-Way Analysis of Variance - Output

67

One-Way Analysis of Variance - Output

Multiple Comparisons

Dependent Variable: BTWT

Tukey HSD

-142.52 71.271 .188 -325.62 40.58

-162.25 88.143 .254 -388.70 64.19

-376.17* 72.556 .000 -562.57 -189.77

142.52 71.271 .188 -40.58 325.62

-19.74 73.127 .993 -207.60 168.13

-233.65* 53.317 .000 -370.62 -96.68

162.25 88.143 .254 -64.19 388.70

19.74 73.127 .993 -168.13 207.60

-213.92* 74.379 .021 -405.00 -22.83

376.17* 72.556 .000 189.77 562.57

233.65* 53.317 .000 96.68 370.62

213.92* 74.379 .021 22.83 405.00

(J) BMI CategoryNormal

Overweight

Obese

Underweight

Overweight

Obese

Underweight

Normal

Obese

Underweight

Normal

Overweight

(I) BMI CategoryUnderweight

Normal

Overweight

Obese

MeanDifference

(I-J) Std. Error Sig.LowerBound

UpperBound

95% Confidence Interval

The mean difference is significant at the .05 level.*.

68

Wilcoxon Signed Ranks Test

• In the menu, click Statistics

• Choose Nonparametric Tests

• Click 2 Related Samples

69

Wilcoxon Signed Ranks Test

• Move selected variable pairs to the Test Pair(s) List box.

• Choose the statistical test(s).

• Click Options...

70

Wilcoxon Signed Ranks Test

Check Descriptives box for descriptive

statistics.

71

Wilcoxon Signed Ranks Test

Click OK to run the procedure.

72

Wilcoxon Signed Ranks TestRanks

0a .00 .00

27b 14.00 378.00

7c

34

Negative Ranks

Positive Ranks

Ties

Total

Apgar 5 minute score -Apgar 1 minute score

N Mean RankSum ofRanks

Apgar 5 minute score < Apgar 1 minute scorea.

Apgar 5 minute score > Apgar 1 minute scoreb.

Apgar 1 minute score = Apgar 5 minute scorec. Test Statisticsb

-4.631a

.000

Z

Asymp. Sig. (2-tailed)

Apgar 5minutescore -Apgar 1minutescore

Based on negative ranks.a.

Wilcoxon Signed Ranks Testb.

73

Mann-Whitney U Test

• In the menu, click Statistics

• Choose Nonparametric Tests

• Click 2 Independent Samples

74

Mann-Whitney U Test

• Select and move– Test Variable(s)

– GroupingVariable

• Click Define Groups.

75

Mann-Whitney U Test

• Enter the values for the groups.

• Click Continue.

76

Mann-Whitney U Test

• Click Options.

• After changing options, click Continue.

• Click OK to run the procedure.

77

Mann-Whitney U Test - OutputDescriptive Statistics

34 7.29 2.44 0 9

47 .60 .50 0 1

Apgar 1 minute score

Smokes cigarettes?

N MeanStd.

Deviation Minimum Maximum

Ranks

14 19.89 278.50

20 15.82 316.50

34

Smokes cigarettes?no

yes

Total

Apgar 1 minute scoreN Mean Rank

Sum ofRanks

Test Statisticsb

106.500

316.500

-1.238

.216

.245a

Mann-Whitney U

Wilcoxon W

Z

Asymp. Sig. (2-tailed)

Exact Sig. [2*(1-tailedSig.)]

Apgar 1minutescore

Not corrected for ties.a.

Grouping Variable: Smokes cigarettes?b.

78

Kruskal-Wallis Test

• In the menu, click Statistics

• Choose Nonparametric Tests

• Click K Independent Samples

79

Kruskal-Wallis Test

• Move the dependent variable(s) to the Test Variable List box.

• Move the grouping variable(s) to the Grouping Variable box.

• Click Define Range.

80

Kruskal-Wallis Test

• Enter the minimum and maximum values for the Grouping Variable.

• Click Continue.

81

Kruskal-Wallis Test

• Check the box for the Kruskal-Wallis H.

• Click OK to run the procedure.

82

Kruskal-Wallis Test - OutputRanks

201 242.52

340 347.55

108 407.53

649

Age group<20

20-29

30+

Total

BMIN Mean Rank

Test Statisticsa,b

64.743

2

.000

Chi-Square

df

Asymp. Sig.

BMI

Kruskal Wallis Testa.

Grouping Variable: Age groupb.

83

Using SPSS© for Windows -Editing the Output

• Pivot Tables• Scatterplots• Charts

84

Scatterplot

• In the menu, click on Graphs.

• Choose Scatter….

85

Scatterplot

• Choose the appropriate type of plot.

• Click Define.

86

Scatterplot

• Select and move the variables for the X and Y axes to the appropriate box.

• Click OK to run the procedure.

87

BMI

70605040302010

BT

WT

5000

4000

3000

2000

1000

0

Scatterplot - Output

Regression line must be added.

88

Edit the Scatterplot

In the Output Window• Click the chart object to select it.

• In the menu, click Edit. • Choose SPSS Chart Object.

• Click Open.

89

Scatterplot

The Chart Window

will open.

90

Edit the Scatterplot

In the Chart Window• In the menu, click Chart.

• Click Options.

91

Edit the Scatterplot

• Check the Total box.• Click OK.

92

Scatterplot - Output

Regression line is added.

BMI

70605040302010

BT

WT

5000

4000

3000

2000

1000

0

93

Syntax Files

A Syntax File is a text file that contains SPSS commands.

94

Uses for Syntax Files

• Some commands and options are available only by using command syntax.

• Syntax files let you save a program so you can repeat it or edit it to use different variables.

• Syntax files let you run a program using SPSS Production Facility.

95

Copying to a Syntax File

The Paste button copies the

commands for a procedure into a

syntax file.

96

Editing Syntax Files

A syntax file can be edited in the Syntax Editor window.

97

Opening a New Syntax File

A new Syntax File can be opened from the File menu.

98

Running Syntax Files

A syntax file can be edited in the Syntax Editor window.

99

SPSS KeyWords newsletter:http://www.spss.com/keywords/

Chi Squarehttp://vflylab.calstatela.edu/edesktop/VirtApps/VflyLab/ChiSqBg.html

Recommended