24
An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go to https://virtualdesktop.uiowa.edu and choose SPSS 25. NOTE: Save data files in a drive that is accessible from virtual desktop. This is probably your H : drive through the university. Contents 1 Example SPSS Data Set from UCLA 2 2 Uploading data to SPSS 2 2.1 SPSS User Windows .................................... 2 2.1.1 Data View ..................................... 2 2.1.2 Variable View .................................... 3 2.1.3 Output Viewer ................................... 3 3 Simple Plots and Correlation in SPSS 3 3.1 Bar Chart .......................................... 3 3.2 Scatterplots (colored by 3rd variable) ........................... 4 3.3 Correlation ......................................... 6 4 Variable manipulation 7 4.1 Standardizing Variables .................................. 7 4.2 Transforming or Combining Variables .......................... 8 4.3 Dichotomizing a continuous variable ........................... 9 5 Logistic Regression 10 6 Two-way tables (categorical variables) 11 7 Split-plot with whole plot as CRD (Type I, assumes sphericity) 12 7.1 Using General Linear Model with Repeated option ................... 12 7.1.1 Format of data ................................... 12 7.1.2 Modeling the data ................................. 12 7.1.3 SPSS output for tests ............................... 15 7.1.4 Profile plots (means) ................................ 16 7.1.5 SAS output for same example ........................... 18 7.1.6 Comment on Residuals ............................... 19 7.2 Using Mixed Models option ................................ 21 7.2.1 Format of data ................................... 21 7.2.2 Modeling the data ................................. 21 7.2.3 SPSS output for tests ............................... 24 1

An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

An introduction to SPSS

To open the SPSS software using U of Iowa Virtual Desktop...Go to https://virtualdesktop.uiowa.edu and choose SPSS 25.

NOTE: Save data files in a drive that is accessible from virtual desktop.This is probably your H : drive through the university.

Contents

1 Example SPSS Data Set from UCLA 2

2 Uploading data to SPSS 22.1 SPSS User Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.1.1 Data View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.1.2 Variable View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.1.3 Output Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Simple Plots and Correlation in SPSS 33.1 Bar Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33.2 Scatterplots (colored by 3rd variable) . . . . . . . . . . . . . . . . . . . . . . . . . . . 43.3 Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

4 Variable manipulation 74.1 Standardizing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74.2 Transforming or Combining Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 84.3 Dichotomizing a continuous variable . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Logistic Regression 10

6 Two-way tables (categorical variables) 11

7 Split-plot with whole plot as CRD (Type I, assumes sphericity) 127.1 Using General Linear Model with Repeated option . . . . . . . . . . . . . . . . . . . 12

7.1.1 Format of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127.1.2 Modeling the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127.1.3 SPSS output for tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157.1.4 Profile plots (means) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167.1.5 SAS output for same example . . . . . . . . . . . . . . . . . . . . . . . . . . . 187.1.6 Comment on Residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

7.2 Using Mixed Models option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217.2.1 Format of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217.2.2 Modeling the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217.2.3 SPSS output for tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

1

Page 2: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

1 Example SPSS Data Set from UCLA

UCLA Institute for Digital Research & Education has some nice statistical software examplesavailable on-line, and we will utilize one of their SPSS data sets for this introduction. The datafile is called binary.sav, and it is available at the URL below, and also at our class website in thedatasets link.

https://stats.idre.ucla.edu/stat/data/binary.sav

This data set contains variables related to admission to graduate school.

Variables:

admit -- Admission status to graduate school (0=no, 1=yes).

gre -- Graduate Record Exam scores. Values range from 200 to 800 (pre-2011 GRE).

gpa -- Grade Point Average.

rank -- Prestige of undergraduate school. Values are 1 through 4. Institutions

with a rank of 1 have the highest prestige, while those with a rank of 4

have the lowest.

2 Uploading data to SPSS

Open the binary.sav in SPSS using File → Open→ Data...

2.1 SPSS User Windows

Upon opening SPSS, you’ll see the window called ‘Data Editor’. Within this window, you havetwo views of the data from which to choose. One looks like a spreadsheet of the actual data (DataView), and the other gives you information on the variables in the data set (Variable View). Youcan move back and forth between the windows by clicking on the respective tab at the bottom leftof the window. After you import data or run any options, you will also see an ‘Output Viewer’window appear.

2.1.1 Data View

• Can be used in a manner similar to a spreadsheet.

– Allows user to enter Data.

– A new column can be entered (Highlight the column location, then Edit → InsertVariable).

– A new row can be entered (Highlight the row location, Edit → Insert Cases).

– You can use a formula to create a new variable, or transform a variable.

2

Page 3: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

2.1.2 Variable View

• Allows user to input characteristics of variables (attributes, coding for missing values, thelevels of class variables, etc.).

• Allows user to quickly view overall characteristics of the variables, like how many variablesare in the data set, how many are categorical (nominal), or continuous (scale), etc.

• Many SPSS data sets arise from surveys and have 100’s of variables, which represent questionson the survey. It can take a long time to input this information, but is quite useful.

2.1.3 Output Viewer

• Contains the output generated by statistical procedures.

• Output location for graphics and plots.

• Can be saved separately from the .SAV data file as a .SPV file.

• Also serves as a ‘log’ box.

3 Simple Plots and Correlation in SPSS

NOTE: For the rest of the simple introduction (Sections 3-6),

we will continue to use the ‘binary.sav’ data set.

• ACTION REQUIRED: Change Variable Type

Go to ‘Variable View’ and make sure rank is set to ordinal. If not, change it to ordinal.

3.1 Bar Chart

• Graphs → Chart Builder → Bar →

• Drag the ‘Simple bar’ visual (1st visual in top row) to the plotting area.

• Drag rank to the x-axis, click OK.

!

3

Page 4: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

3.2 Scatterplots (colored by 3rd variable)

• Graphs → Chart Builder

• You’ll see the “Chart Builder” dialog box appear.

• Highlight Scatter/dot in the Gallery box.

• Drag the ‘Grouped Scatter’ visual (2nd visual in top row) to the plotting area.

• Drag gre to the x-axis and gpa to the y-axis.

• Drag rank to the set color box.

• Click OK (output appears in the Output Viewer box).

4

Page 5: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

5

Page 6: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

3.3 Correlation

• Analyze → Correlate→ Bivariate

• You’ll see the “Bivariate Correlations” dialog box appear.

• Highlight gre, then click the arrow to move it to the Variables box at the right.

• Highlight gpa, then click the arrow to move it to the Variables box at the right.

• Click OK.

The output will appear in the Output Viewer box, as below.

6

Page 7: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

4 Variable manipulation

4.1 Standardizing Variables

• In SPSS, you can quickly standardize a variable and include the standardized ‘z-scores’ asanother column in the data set.

• Analyze → Descriptive Statistics→ Descriptives...

• Highlight gre, then click the arrow to move it to the Variables box at the right.

• Highlight gpa, then click the arrow to move it to the Variables box at the right.

• Check the box at the bottom left: “Save standardized values as variables.”

• Click OK (the new variables will appear in the Data View).

Run a correlation analysis on these two standardized variables and compare the results to thecorrelation analysis using the unstandardized.

7

Page 8: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

4.2 Transforming or Combining Variables

• Highlight an empty column in the ‘Data View’.

• Transform → Compute Variable...

• Create a new variable called ‘PreKnowledge’ which is the average of two standardized variablesby inputting the formula: (Zgre+Zgpa)/2, then clicking OK.

8

Page 9: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

4.3 Dichotomizing a continuous variable

• Transform → Recode into Different Variables...

• You’ll see the “Recode into Different Variables” dialog box appear.

• Highlight gre and put into the Input Variable box.

• Provide a new name called codedGRE in the ‘Name’ box, and press ‘Change’.

• Click on ‘Old and New Values’.

• Under Old Value, select Range, LOWEST through value: 600

• Under New Value, select Value: 0

• Click ‘Add’

• Under Old Value, select Range, value through HIGHEST: 601

• Under New Value, select Value: 1

• Click ‘Add’, click ‘Continue’, click ‘Change’, click ’OK’.

• The new variable will now appear in the ‘Data View’ window.

9

Page 10: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

5 Logistic Regression

• Analyze → Generalized Linear Models→ Generalized Linear Models...

• On the ‘Type of Model’ tab: choose binary logistic.

• On the ‘Response’ tab: enter admit as dependent variable. Also... click ‘Reference Category...’and select ‘First (lower value)’ in order to model the 1’s not 0’s.

• On the ‘Predictors’ tab: enter rank as a Factor, enter gre, gpa as Covariates.

• On the ‘Model’ tab: Include desired terms in the model.(For this example, highlight all and click ‘main effects’ for simplicity. If you want to enter aninteraction, highlight two variables at once, then choose ‘Interaction’.)

• Click OK.

Generalized Linear Models

Case Processing Summary

N Percent

Included 400 100.0%

Excluded 0 0.0%

Total 400 100.0%

Omnibus Testa

Likelihood Ratio

Chi-Square df Sig.

41.459 5 .000

Dependent Variable: admit

Model: (Intercept), rank, gre, gpa

a. Compares the fitted model against the

intercept-only model.

Tests of Model Effects

Source

Type III

Wald Chi-

Square df Sig.

(Intercept) 19.234 1 .000

rank 20.895 3 .000

gre 4.284 1 .038

gpa 5.872 1 .015

Dependent Variable: admit

Model: (Intercept), rank, gre, gpa

!

Model Information

Dependent Variable admita

Probability Distribution Binomial

Link Function Logit

a. The procedure models 1 as the response, treating 0 as the reference category.

10

Page 11: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

Parameter Estimates

Parameter B Std. Error

95% Wald Confidence Interval Hypothesis Test

Lower Upper

Wald Chi-

Square df Sig.

(Intercept) -5.541 1.1381 -7.772 -3.311 23.709 1 .000

[rank=1] 1.551 .4178 .733 2.370 13.787 1 .000

[rank=2] .876 .3667 .157 1.595 5.706 1 .017

[rank=3] .211 .3929 -.559 .981 .289 1 .591

[rank=4] 0a . . . . . .

gre .002 .0011 .000 .004 4.284 1 .038

gpa .804 .3318 .154 1.454 5.872 1 .015

(Scale) 1b Dependent Variable: admit

Model: (Intercept), rank, gre, gpa

a. Set to zero because this parameter is redundant.

b. Fixed at the displayed value.

!

- Output shows rank group 4 is the baseline (or reference) group.

6 Two-way tables (categorical variables)

• Analyze → Descriptive Statistics → Crosstabs...

• Highlight admit and put into the Rows box.

• Highlight codedGRE and put into the Columns box.

• Click on ‘Cells...’ and under Percentages, choose Column Percentages, then Continue.

• Click on ‘Statistics...’ and choose Chi-Squared, then Continue, then OK.

11

Page 12: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

7 Split-plot with whole plot as CRD (Type I, assumes sphericity)

This statistical model has a between-subject and within-subject factor (or factors). The example weuse here was seen in STAT:5201. There were two factors (DayLength and Climate), each with twolevels, that formed the four treatments in the between-subject effects. There was also one within-subject factor (Tissue) with two levels. There were two hamsters in each of the four between-subjecttreatment groups. Thus, each hamster was nested in a particular DayLength/Climate combinationand provided two observations in the analysis (one under each Tissue level).

7.1 Using General Linear Model with Repeated option

7.1.1 Format of data

One way to perform this analysis in SPSS is to approach it as a multivariate response. In thatcase, we need to format the data so that each row is associated with one hamster.

Open the split plot hamsters.sav in SPSS using File → Open→ Data...

7.1.2 Modeling the data

Choose Analyze → General Linear Models→ Repeated Measures...

12

Page 13: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

Then give your within-subject factor a name (such as ‘Tissue’ here) and state how many levelsit has, then press ‘Add’ and ‘Define’.

Next, input the particular column names that coincide with the within-subject factor levels in theupper box, and define your model by inputting the between-subject factors in the appropriatebox below (the default model includes all interactions between these factors).

13

Page 14: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

The default model will include all interactions. If you would like to adjust this, you can click onthe ‘Model’ button to customize your model (I’ll keep the default here). If you click on the ‘EMMeans’ button, you can choose which estimated marginal means are displayed (the default is toshow none). Here, I will choose to display the individual ‘cell means’ or the eight non-pooled means.

Next, click the ‘Save’ button and request to save the residuals and predicted values. This willsave new columns in your present data set. Click ‘Continue’ and then ’OK’.

14

Page 15: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

7.1.3 SPSS output for tests

With respect to model terms, you’ll first get the within-subject tests.

Tests of Within-Subjects Effects

Measure: MEASURE_1Measure: MEASURE_1Measure: MEASURE_1

SourceType III Sum of Squares df Mean Square F

Tissue Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound

Tissue * DayLength Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound

Tissue * Climate Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound

Tissue * DayLength * Climate

Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound

Error(Tissue) Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound

385.730 1 385.730 133.155 .000385.730 1.000 385.730 133.155 .000385.730 1.000 385.730 133.155 .000385.730 1.000 385.730 133.155 .000

27.563 1 27.563 9.515 .03727.563 1.000 27.563 9.515 .03727.563 1.000 27.563 9.515 .03727.563 1.000 27.563 9.515 .037

6.325 1 6.325 2.183 .2146.325 1.000 6.325 2.183 .2146.325 1.000 6.325 2.183 .2146.325 1.000 6.325 2.183 .2142.418 1 2.418 .835 .4132.418 1.000 2.418 .835 .4132.418 1.000 2.418 .835 .4132.418 1.000 2.418 .835 .413

11.587 4 2.89711.587 4.000 2.89711.587 4.000 2.89711.587 4.000 2.897

Measure: MEASURE_1Measure: MEASURE_1

Page 1

And then the between-subject tests farther down in the output.

Tests of Between-Subjects Effects

Measure: MEASURE_1Measure: MEASURE_1Transformed Variable: AverageTransformed Variable:

Source

Transformed Variable: Average

Type III Sum of Squares df Mean Square F Sig.

InterceptDayLengthClimateDayLength * ClimateError

626.751 1 626.751 96.498 .00142.445 1 42.445 6.535 .06318.233 1 18.233 2.807 .169

1.538 1 1.538 .237 .65225.980 4 6.495

Measure: MEASURE_1Transformed Variable: Average

Page 1

15

Page 16: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

And the requested expected marginal means.

DayLength * Climate * TissueMeasure: MEASURE_1Measure: MEASURE_1Measure: MEASURE_1

DayLength Climate Tissue Mean Std. Error95% Confidence Interval

Lower Bound Upper Bound

long cold 1

2

warm 1

2

short cold 1

2

warm 1

2

.515 .645 -1.276 2.306

7.230 2.069 1.486 12.974

1.550 .645 -.241 3.341

9.225 2.069 3.481 14.969

1.305 .645 -.486 3.096

11.715 2.069 5.971 17.459

2.025 .645 .234 3.816

16.505 2.069 10.761 22.249

Measure: MEASURE_1Measure: MEASURE_1

Page 1

7.1.4 Profile plots (means)

You can also request some profile plots by clicking on the ‘Plots...’ option and inputting horizontalaxis variable (DayLength), separate lines variable(Climate), and separate plots variable (Tissue).Click ‘Add’ then ‘Continue’.

16

Page 17: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

DayLengthshortlong

Estim

ated

Mar

gina

l Mea

ns

2.5000000000000000

2.0000000000000000

1.5000000000000000

1.0000000000000000

.5000000000000000

Estimated Marginal Means of MEASURE_1

at Tissue = 1

warmcold

Climate

Page 1

DayLengthshortlong

Estim

ated

Mar

gina

l Mea

ns

17.5000000000000000

15.0000000000000000

12.5000000000000000

10.0000000000000000

7.5000000000000000

Estimated Marginal Means of MEASURE_1

at Tissue = 2

warmcold

Climate

Page 1

17

Page 18: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

7.1.5 SAS output for same example

From PROC MIXED, we see the tests for fixed effects are the same.

Type 3 Tests of Fixed Effects

Num Den

Effect DF DF F Value Pr > F

DayLength 1 4 6.54 0.0629

Climate 1 4 2.81 0.1692

DayLength*Climate 1 4 0.24 0.6520

Tissue 1 4 133.16 0.0003

DayLength*Tissue 1 4 9.51 0.0368

Climate*Tissue 1 4 2.18 0.2136

DayLen*Climat*Tissue 1 4 0.83 0.4126

From PROC GLM, we see all the sums of squares are equivalent, and we see that there are twodistinct errors (for the whole-plot level and split-plot level) and this matches the SPSS output.

The GLM Procedure

Tests of Hypotheses for Mixed Model Analysis of Variance

Dependent Variable: NI

Source DF Type III SS Mean Square F Value Pr > F

DayLength 1 42.445225 42.445225 6.54 0.0629

Climate 1 18.232900 18.232900 2.81 0.1692

DayLength*Climate 1 1.537600 1.537600 0.24 0.6520

Error 4 25.979950 6.494987

Error: MS(Hamst(DayLen*Climat))

Source DF Type III SS Mean Square F Value Pr > F

Tissue 1 385.729600 385.729600 133.16 0.0003

DayLength*Tissue 1 27.562500 27.562500 9.51 0.0368

Climate*Tissue 1 6.325225 6.325225 2.18 0.2136

DayLen*Climat*Tissue 1 2.418025 2.418025 0.83 0.4126

Hamst(DayLen*Climat) 4 25.979950 6.494987 2.24 0.2267

Error: MS(Error) 4 11.587350 2.89683

18

Page 19: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

7.1.6 Comment on Residuals

It looks like the residuals that you receive from SPSS are not the ‘conditional residuals’ but ratherthe marginal residuals (what’s leftover after accounting for the fixed effects). For checking theassumptions of the bottom-level noise (or σ2), we want to consider the residuals after accountingfor the random hamster effects, which are the conditional residuals.

SPSS residuals and predicted values (only 8 predicted values in the plot):

0 5 10 15

-2-1

01

2

Preds

Resids

-2 -1 0 1 2

-2-1

01

2

Normal Q-Q Plot

Theoretical Quantiles

Sam

ple

Qua

ntile

s

SAS residuals and predicted values (more predicted values because they include the BLUPs):

19

Page 20: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

The marginal residuals from SAS (this doesn’t check our assumptions on εijk):

20

Page 21: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

7.2 Using Mixed Models option

7.2.1 Format of data

For this modeling, we will have the data in the same format as SAS, with one observation per row.

Open the split plot hamsters format 2.sav in SPSS using File → Open→ Data...

7.2.2 Modeling the data

Choose Analyze → Mixed Models→ Linear... and you will see the screen below to setup thesubject factor. Once hamster is entered as the subject, click ‘Continue’.

21

Page 22: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

Then choose your factors in the model (both fixed and random for now).

Click on ‘Fixed...’ to set-up fixed factors. We want to add all main effects and interactions in thethree factors of interest. Then press ‘Continue’.

22

Page 23: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

Click on ‘Random...’ to set-up the nested hamster effect. Choose the button ‘Build nested terms’and ‘Include intercept’. Highlight Hamster and then click the blue down arrow button.

Click on ‘(Within)’ and highlight DayLength and press the blue down arrow button, and then clickon ‘By*’ and highlight Climate and press the blue down arrow button and then click the blue ‘Add’then ‘Continue’.

23

Page 24: An introduction to SPSShomepage.divms.uiowa.edu/~rdecook/stat6220/Class_notes/SPSS_i… · An introduction to SPSS To open the SPSS software using U of Iowa Virtual Desktop... Go

Click the ‘Save’ button and under the section ‘Predicted Values & Residuals’ request to save theresiduals and predicted values and click ‘Continue’ (this will save new columns in your presentdata set), then click ’OK’ to run the model.

7.2.3 SPSS output for tests

Type III Tests of Fixed Effectsa

Source Numerator df Denominator df F Sig.InterceptDayLengthClimateTissueDayLength * ClimateDayLength * TissueClimate * TissueDayLength * Climate * Tissue

1 4 96.498 .0011 4 6.535 .0631 4 2.807 .1691 4 133.155 .0001 4 .237 .6521 4 9.515 .0371 4 2.183 .214

1 4 .835 .413

Dependent Variable: NI.a.

Page 1

Estimates of Covariance Parametersa

Parameter Estimate Std. ErrorResidualHamster(DayLength * Climate)

Variance2.896837 2.048373

1.799075 2.514372

Dependent Variable: NI.a.

Page 1

Predicted Values

15.000010.00005.0000.0000

Res

idua

ls

2.0000

1.0000

.0000

-1.0000

-2.0000

Simple Scatter of Residuals by Predicted Values

Page 1

And the SPSS output and residuals above and match the SAS analysis.

24