12e.1 anova within subjects these notes are developed from “approaching multivariate analysis: a...

22
12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and Harry Staines.

Upload: jessie-austin

Post on 31-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.1

ANOVA Within SubjectsThese notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and Harry Staines.

Page 2: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.2

An Example for Within Subjects

This study is designed to determine whether choice reaction time (CRT) might serve as a marker of neurological function that could be used to assess the impact of experimental therapies on presymptomatic gene carriers for Huntington’s disease.

Ten presymptomatic gene carriers, identified through family history investigations followed by genetic testing, are recruited. They complete a CRT task on three occasions at intervals of one year. The CRT task involves making a left or right touch response on a touch-sensitive screen to a visual or auditory stimulus presented to the individual’s left or right. The visual and auditory stimuli are presented in blocks, with order of modality balanced across participants.

year of test year 1 year 2 year 3

participant visual auditory visual auditory visual auditory 1 240 261 251 266 259 264 2 290 288 300 293 306 318 3 326 342 328 350 334 363 4 255 268 262 267 270 278 5 260 284 324 290 313 321 6 292 264 322 292 320 329 7 279 266 301 284 332 326 8 289 260 293 309 306 297 9 301 264 335 283 320 268 10 292 317 302 313 307 309

Page 3: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.3

An Example for Within Subjects

So we have a 3 × 2 factorial design with two within-subjects (repeated measures) factors: year (year 1, year 2, year 3) and modality (visual, auditory). The dependent variable is mean CRT for 30 trials in each of the six conditions.  

year of test year 1 year 2 year 3

participant visual auditory visual auditory visual auditory 1 240 261 251 266 259 264 2 290 288 300 293 306 318 3 326 342 328 350 334 363 4 255 268 262 267 270 278 5 260 284 324 290 313 321 6 292 264 322 292 320 329 7 279 266 301 284 332 326 8 289 260 293 309 306 297 9 301 264 335 283 320 268 10 292 317 302 313 307 309

Page 4: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.4

An Example for Within Subjects

We will call our two within-subjects variables MODE (with two levels, 'visual' and 'auditory'), and YEAR with three levels, 1, 2 and 3. Notice that the two levels of MODE are both used within each level of YEAR, giving the two within-subjects variables a hierarchical structure. As always we need one row of the SPSS datasheet for each participant, and we need a variable name for each of the six columns of observations.

The easiest way might be just to call the observations TIME1, TIME2, …, TIME6, or we might prefer to call them Y1M1, Y1M2, …, Y3M2 (where 'Y' stands for YEAR and 'M' stands for MODE), which reflects the meaning of the six conditions. This is what we have done, so the SPSS datasheet contains the six columns of data arranged as in the table, with the six variables named Y1M1, Y1M2, …..Y3M2.

year of test year 1 year 2 year 3

participant visual auditory visual auditory visual auditory 1 240 261 251 266 259 264 2 290 288 300 293 306 318 3 326 342 328 350 334 363 4 255 268 262 267 270 278 5 260 284 324 290 313 321 6 292 264 322 292 320 329 7 279 266 301 284 332 326 8 289 260 293 309 306 297 9 301 264 335 283 320 268 10 292 317 302 313 307 309

Page 5: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.5

Requesting The AnalysisWe select from the menu bar Analyze, General Linear Model and Repeated Measures, and we get the SPSS Dialog Box.

Page 6: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.6

Requesting The AnalysisWe have two within-subjects factors to enter, and we need to do it in the correct order, with YEAR first, since that is the one that contains each level of MODE. So type YEAR in the Within-Subject Factor Name box, 3 in the Number of Levels box, and click Add. Then repeat the process with MODE and 2.

Page 7: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.7

Requesting The AnalysisWe have two within-subjects factors to enter, and we need to do it in the correct order, with YEAR first, since that is the one that contains each level of MODE. So type YEAR in the Within-Subject Factor Name box, 3 in the Number of Levels box, and click Add. Then repeat the process with MODE and 2.

Page 8: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.8

Requesting The AnalysisThere is no need to type anything in the Measure Name box, but if you like you could type TIME for the dependent variable to give us SPSS Dialog Box as shown. Click Define to get the SPSS Dialog Box.

Page 9: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.9

Requesting The AnalysisAll we have to do is use the arrow to put the variables into the Within-Subjects Variables box in the correct order, so the result is as shown. You can check that the factors were entered in the correct order: see that the first column of the datasheet, Y1M1, is labelled (1,1), both factors at level 1. The second column, Y1M2 is labelled (1,2), factor 1 (YEAR) is at level 1 and factor 2 (MODE) is at level 2. This is correct for our first two columns of data. You can easily check that the entries are correct for the remaining four columns. We have no between-subjects factors or covariates.

Page 10: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.10

Requesting The Analysis

Page 11: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.11

Requesting The Analysis

If we click the Model button we get a dialog box. We can either accept the default (Full Factorial) or click the Custom radio button and enter the main effects for MODE and YEAR and their interaction. The results are exactly the same so we may as well accept the default.

Page 12: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.12

Requesting The Analysis

In the Plots dialog box, put YEAR in the Horizontal Axis box and MODE in the Separate Lines box, don’t forget to select Add.

Page 13: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.13

Requesting The AnalysisIn the Options dialog box, click Estimates of effect size and Observed power. Homogeneity tests are not available for within-subjects factors.

Page 14: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.14

Requesting The AnalysisYou can get Residual plots but there will be one for each of the variables Y1M1 to Y3M2, each with ten points on it (one for each subject). The ten points on the Y1M1 plot all have YEAR at level 1 and MODE at level 1 so they all have the same predicted value. This means that, in a plot of predicted values on the horizontal axis against residual values on the vertical axis, all ten points will lie on a straight vertical line. All you can observe, therefore, is whether any of the points lie a long way from the others, indicating a poor fit for the corresponding observation. The same is true for each of the plots for the rest of the variables Y1M2 to Y3M2. None of the plots show such an effect and we don't reproduce them here.

Page 15: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.15

Requesting The AnalysisNow all that remains is to click Continue and OK to get the analysis.

Page 16: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.16

Understanding The Output

The first table in the output is a summary of the data, which is a useful check on the way the factors were defined (SPSS Output). Here you can see that we entered our two factors in the correct order, our six columns of data corresponding in pairs to the three levels of YEAR.

Within-Subjects Factors Measure:TIME

YEAR MODE Dependent

Variable 1 1 y1m1

2 y1m2 2 1 y2m1

2 y2m2 3 1 y3m1

2 y3m2

Page 17: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.17

Understanding The Output

First, we need to look at the result of the Mauchly sphericity test, which is in SPSS Output. We see that the result is nonsignificant for YEAR and for the interaction (YEAR*MODE). There is no test for MODE because it has only two levels.

Mauchly's Test of Sphericityb Measure:TIME

Within Subjects Effect Mauchly's W Approx. Chi-

Square df Sig.

Epsilona Greenhouse-Geisser

Huynh-Feldt

Lower-bound

YEAR .749 2.315 2 .314 .799 .945 .500 MODE 1.000 .000 0 . 1.000 1.000 1.000 YEAR * MODE .912 .737 2 .692 .919 1.000 .500 Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent variables is proportional to an identity matrix. a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected tests are displayed in the Tests of Within-Subjects Effects table. b. Design: Intercept Within Subjects Design: YEAR + MODE + YEAR * MODE

Page 18: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.18

Understanding The OutputTests of Within-Subjects Effects

Measure:TIME

Source

Type III Sum of

Squares df Mean

Square F Sig.

Partial Eta

Squared Noncent.

Parameter Observed

Powera YEAR Sphericity

Assumed 6492.633 2 3246.317 14.711 .000 .620 29.423 .996

Greenhouse-Geisser

6492.633 1.598 4061.885 14.711 .001 .620 23.515 .987

Huynh-Feldt 6492.633 1.889 3436.407 14.711 .000 .620 27.795 .994 Lower-bound 6492.633 1.000 6492.633 14.711 .004 .620 14.711 .925

Error(YEAR) Sphericity Assumed

3972.033 18 220.669 Greenhouse-Geisser

3972.033 14.386 276.107 Huynh-Feldt 3972.033 17.004 233.590 Lower-bound 3972.033 9.000 441.337

MODE Sphericity Assumed

93.750 1 93.750 .159 .699 .017 .159 .065

Greenhouse-Geisser

93.750 1.000 93.750 .159 .699 .017 .159 .065

Huynh-Feldt 93.750 1.000 93.750 .159 .699 .017 .159 .065 Lower-bound 93.750 1.000 93.750 .159 .699 .017 .159 .065

Error(MODE) Sphericity Assumed

5300.417 9 588.935 Greenhouse-Geisser

5300.417 9.000 588.935 Huynh-Feldt 5300.417 9.000 588.935 Lower-bound 5300.417 9.000 588.935

YEAR * MODE

Sphericity Assumed

165.100 2 82.550 .680 .519 .070 1.361 .147

Greenhouse-Geisser

165.100 1.838 89.815 .680 .508 .070 1.251 .142

Huynh-Feldt 165.100 2.000 82.550 .680 .519 .070 1.361 .147 Lower-bound 165.100 1.000 165.100 .680 .431 .070 .680 .115

Error(YEAR*MODE)

Sphericity Assumed

2184.233 18 121.346

Greenhouse-Geisser

2184.233 16.544 132.026

Huynh-Feldt 2184.233 18.000 121.346 Lower-bound 2184.233 9.000 242.693

a. Computed using alpha = .05

As the Mauchly test of sphericity was non-significant, we can look at the 'Sphericity Assumed' rows of the table, where we see that only the effect of YEAR is significant (F(2,18) = 14.71, p < 0.001) with partial η2 = 0.62 and power = 1.00.

Had the sphericity test been significant, we would have needed to look at one of the other rows, which make various adjustments to the dfs to allow for the violation of the sphericity assumption.

Page 19: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.19

Understanding The OutputTests of Within-Subjects Effects

Measure:TIME

Source

Type III Sum of

Squares df Mean

Square F Sig.

Partial Eta

Squared Noncent.

Parameter Observed

Powera YEAR Sphericity

Assumed 6492.633 2 3246.317 14.711 .000 .620 29.423 .996

Greenhouse-Geisser

6492.633 1.598 4061.885 14.711 .001 .620 23.515 .987

Huynh-Feldt 6492.633 1.889 3436.407 14.711 .000 .620 27.795 .994 Lower-bound 6492.633 1.000 6492.633 14.711 .004 .620 14.711 .925

Error(YEAR) Sphericity Assumed

3972.033 18 220.669 Greenhouse-Geisser

3972.033 14.386 276.107 Huynh-Feldt 3972.033 17.004 233.590 Lower-bound 3972.033 9.000 441.337

MODE Sphericity Assumed

93.750 1 93.750 .159 .699 .017 .159 .065

Greenhouse-Geisser

93.750 1.000 93.750 .159 .699 .017 .159 .065

Huynh-Feldt 93.750 1.000 93.750 .159 .699 .017 .159 .065 Lower-bound 93.750 1.000 93.750 .159 .699 .017 .159 .065

Error(MODE) Sphericity Assumed

5300.417 9 588.935 Greenhouse-Geisser

5300.417 9.000 588.935 Huynh-Feldt 5300.417 9.000 588.935 Lower-bound 5300.417 9.000 588.935

YEAR * MODE

Sphericity Assumed

165.100 2 82.550 .680 .519 .070 1.361 .147

Greenhouse-Geisser

165.100 1.838 89.815 .680 .508 .070 1.251 .142

Huynh-Feldt 165.100 2.000 82.550 .680 .519 .070 1.361 .147 Lower-bound 165.100 1.000 165.100 .680 .431 .070 .680 .115

Error(YEAR*MODE)

Sphericity Assumed

2184.233 18 121.346

Greenhouse-Geisser

2184.233 16.544 132.026

Huynh-Feldt 2184.233 18.000 121.346 Lower-bound 2184.233 9.000 242.693

a. Computed using alpha = .05

We consider these in the next section on MANOVA. For YEAR, it makes sense to ask whether the linear trend was significant, since the time taken to reach a decision could depend on progress of the disease with time. That information is provided in the next (Tests of Within-Subjects Contrasts) table.

Page 20: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.20

Understanding The Output

We can report that the linear trend was significant (F(1,9) = 19.09, p < 0.01). The final table (Tests of Between-Subjects Effects) is of no interest when we have no between-subjects factors, as all it does is test the hypothesis that the overall mean is not zero, and it is not reproduced here.

Tests of Within-Subjects Contrasts Measure:TIME

Source

MODE Type III Sum of Squares df

Mean Square F Sig.

Partial Eta Squared

Noncent. Parameter

Observed Powera

YEAR Linear 6300.100 1 6300.100 19.095 .002 .680 19.095 .972 Quadratic

192.533 1 192.533 1.728 .221 .161 1.728 .218

Error(YEAR) Linear 2969.400 9 329.933 Quadratic

1002.633 9 111.404

MODE Linear 93.750 1 93.750 .159 .699 .017 .159 .065 Error(MODE) Linear 5300.417 9 588.935 YEAR * MODE

Linear Linear 6.400 1 6.400 .067 .802 .007 .067 .056 Quadratic

Linear 158.700 1 158.700 1.080 .326 .107 1.080 .154

Error(YEAR*MODE)

Linear Linear 862.100 9 95.789 Quadratic

Linear 1322.133 9 146.904

a. Computed using alpha = .05

Page 21: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.21

Understanding The Output

We can see that the decision TIME increases steadily with YEAR, for both 'visual' (MODE level 1) and 'auditory' (MODE level 2), with the values for 'auditory' similar to those for 'visual' at YEAR = 1 and 3 and somewhat lower than those for 'visual' at YEAR = 2 degrees.

However, our ANOVA tells us that neither the difference between the two levels of MODE nor its interaction with YEAR are significant: with this number of observations a difference of this size could just be due to random variation.

Page 22: 12e.1 ANOVA Within Subjects These notes are developed from “Approaching Multivariate Analysis: A Practical Introduction” by Pat Dugard, John Todman and

12e.22

SyntaxGET FILE='12e.sav'. ← include your own directory structure c:\…DISPLAY DICTIONARY /VARIABLES y1m1 y1m2 y2m1 y2m2 y3m1 y3m2. GLM y1m1 y1m2 y2m1 y2m2 y3m1 y3m2 /WSFACTOR=YEAR 3 Polynomial MODE 2 Polynomial /MEASURE=TIME /METHOD=SSTYPE(3) /PLOT=PROFILE(YEAR*MODE) /PRINT=ETASQ OPOWER /PLOT=RESIDUALS /CRITERIA=ALPHA(.05) /WSDESIGN=YEAR MODE YEAR*MODE. 

The following commands may be employed to repeat the analysis.