36
1 Psych 5510/6510 Chapter 14 Repeated Measures ANOVA: Models with Nonindependent ERRORs Part 2 (Crossed Designs) Spring, 2009

Psych 5510/6510

Embed Size (px)

DESCRIPTION

Psych 5510/6510. Chapter 14 Repeated Measures ANOVA: Models with Nonindependent ERRORs Part 2 (Crossed Designs). Spring, 2009. Nonindependence in Crossed Designs. Now we are going to look at crossed designs. - PowerPoint PPT Presentation

Citation preview

Page 1: Psych 5510/6510

1

Psych 5510/6510

Chapter 14

Repeated Measures ANOVA:

Models with Nonindependent ERRORs

Part 2 (Crossed Designs)

Spring, 2009

Page 2: Psych 5510/6510

2

Nonindependence in Crossed Designs

Now we are going to look at crossed designs.

Example: Each subject is measured once in both conditions (Experimenter Absent and Experimenter Present). Thus the effect of the independent variable is now showing up within-subjects.

Page 3: Psych 5510/6510

3

Design

Experimenter Absent Experimenter Present

S1 S1

S2 S2

S3 S3

S4 S4

S5 S5

S6 S6

S7 S7

S8 S8

Page 4: Psych 5510/6510

4

Subject Y1: Exp. Absent Y2: Exp. Present

1 7 8

2 5 5

3 6 6

4 7 9

5 8 8

6 7 7

7 5 6

8 6 8

6.375 7.125hY

Data: Note two scores per subject.

Page 5: Psych 5510/6510

5

InappropriateAnalysis

Subject Y X (group)

S1 7 -1

S2 5 -1

S3 6 -1

S4 7 -1

S5 8 -1

S6 7 -1

S7 5 -1

S8 6 -1

S1 8 1

S2 5 1

S3 6 1

S4 9 1

S5 8 1

S6 7 1

S7 6 1

S8 8 1

Ignore that there are two scoresfrom each subject (one in eachgroup).

Contrast code group (X).

Page 6: Psych 5510/6510

6

Inappropriate Analysis

Model C: Ŷi = βo

Ŷi = 6.75

Model A: Ŷi = βo + β1Xi

Ŷi = 6.75 + .375Xi

Page 7: Psych 5510/6510

7

Inappropriate Analysis (cont.)

Ŷi = 6.75 + .375Xi

Source Source Source b SS df MS F* PRE p

SSR Regression Model

(Xi)

.375 2.253 1 2.253 1.52 .10 .238

SSE(A) Residual Error 20.75 14 1.58

SSE(C) Total Total 23 15

Page 8: Psych 5510/6510

8

Residuals from inappropriate analysis

.875-.3758

-1.125-1.3757

-.125.6256

.8751.6255

1.875.6254

-1.125-.3753

-2.125-1.3752

.875.6251

Exp. PresentExp. AbsentSubject

Positive nonindependence

Page 9: Psych 5510/6510

9

Appropriate Approach

Due to likely nonindependence among the scores from the same subject, the solution is once again to change the nonindependent scores into one score per person. Remember how we handled this last semester when we learned the t test for dependent groups, we computed a ‘difference’ score for each subject, reflecting how their score differed from the first measure to the second. We then analyzed the difference scores.

Page 10: Psych 5510/6510

10

From t Test for Dependent GroupsSubject Y1: Exp. Absent Y2: Exp. Present Difference

1 7 8 -1

2 5 5 0

3 6 6 0

4 7 9 -2

5 8 8 0

6 7 7 0

7 5 6 -1

8 6 8 -2

The ‘difference’ scores measure the effect of the independent variableon each subject, we then test to see whether the mean differencescore differ significantly from zero.

Page 11: Psych 5510/6510

11

W1 Scores

We are going to do something very similar using the same formula as before but with different deltas.

h

2h

hihi

YW

h

707.11

)8(1)( )7)(1(

11

)(1)(Y )Y)(1(W

2222

211i

ii

The deltas come from our contrast code (X=-1 and 1). We plug in the two scores for each subject to arrive at a W1 score for each subject. The W1 score for the first subject is shown below.

Page 12: Psych 5510/6510

12

W1i ScoresSubject Y1

Exp. Absent

Y2

Exp. Present

W1i

1 7 8 .707

2 5 5 .0

3 6 6 .0

4 7 9 1.414

5 8 8 .0

6 7 7 .0

7 5 6 .707

8 6 8 1.414

Note that when the subject gets the same scores in both Y1 and Y2 that W1i=0

Page 13: Psych 5510/6510

13

Subject Y1: Exp. Absent Y2: Exp. Present Difference W1

1 7 8 -1 .707

2 5 5 0 0

3 6 6 0 0

4 7 9 -2 .1414

5 8 8 0 0

6 7 7 0 0

7 5 6 -1 .707

8 6 8 -2 .1414

W1 is a measure of the difference between the subjects’ two scores.If the independent variable had no effect the mean value of the W1scores would be zero The reason the W1 scores have the opposite sign of the difference scores is simply because I used (-1 and 1) for the contrast rather then (1 and –1).

Page 14: Psych 5510/6510

14

Expected ValueIf we look at the mean value of W1 across subjects

we find it is:

Which will equal 0 if there is no difference between the means of the two conditions.

So….if the independent variable had no effect we would expect the mean of the W scores to equal zero…consequently…

2

)Y( )Y(W 21

1

Page 15: Psych 5510/6510

15

Approach

We then do the multiple regression approach (Chapter 5) of testing to see if the mean of the variable we are modeling (i.e. W1) is equal to some value (i.e. zero).

Page 16: Psych 5510/6510

16

The Models and Hypotheses

Following the procedures of Chapter 5:

Model C: Ŵi = Bo where Bo=0 PC=0

Model A: Ŵi = βo where βo = μw PA=1

H0: βo = Bo or μw = 0

HA: βo Bo or μw 0

Page 17: Psych 5510/6510

17

Computations

5.73.39

2.25

MS

MSF*

.397

2.75

df

SSE(A)MS

2.251

2.25

df

SSRMS

8PCNdf

7PANdf

1PCPAdf

45.00.5

25.2

SSE(C)

SSR PRE

5.00 2.75 2.25 SSR SSE(A) SSE(C)

2.75scores W theof SSSS SSE(A)

25.2)53(.8Wn SSR

A Model

reduced

AA Model

reducedreduced

C

A

reduced

1W

22

1

1

p=.0479

Page 18: Psych 5510/6510

18

Appropriate Summary Table

In the table above the value of b has been changed back to the metric of the original Y scores by dividing it by the denominator of the W formula (this is a convention).

Compare this summary table to the inappropriate analysis, there is a huge drop in SSE(A) and SSE(C) when doing it this way (while SSR is the same in both approaches).

Source Source Source b SS df MS F* PRE p

SSR Regression Model

(Xi)

.375 2.253 1 2.253 5.73 .45 .048

SSE(A) Residual Error 2.75 7 .39

SSE(C) Total Total 5 8

Page 19: Psych 5510/6510

19

Why the Drop in Error?

With the original Y scores the variance between the subjects within each group is part of the error that can’t be explained by the independent variable. With the W1 analysis the variance of the W1 scores is part of the error that can’t be explained by the independent variable. Remember that W1 scores measure the effect of the IV on each subject, in our example the IV had a pretty similar effect on everyone, thus the W1 scores didn’t vary much. So what can’t be explained by the independent variable is less with the W1 scores than with the Y scores (see next slide).

Page 20: Psych 5510/6510

20

Subject Y1: Exp. Absent Y2: Exp. Present W1

1 7 8 .707

2 5 5 0

3 6 6 0

4 7 9 .1414

5 8 8 0

6 7 7 0

7 5 6 .707

8 6 8 .1414

The scores within Y1 and Y2 vary more than the scores withinW1, thus the analysis of the W1 scores will be more powerful.This is common in repeated measures designs, that the effect of the independent variable (measured by W1) shows less variabilitythan the differences between subjects (as reflected in their Y scores)

Page 21: Psych 5510/6510

21

The Error Term

What is MSerror in the summary table?

1) Model A is using the mean of W to predict each W score.

2) W measures the effect of the IV on each individual.

3) If the W scores differ from each other (i.e. differ from mean of W) then that is due to the IV having different effects on each individual, and there will be error in the model...

Source Source Source b SS df MS F* PRE p

SSR Regression Model

(Xi)

.375 2.253 1 2.253 5.73 .45 .048

SSE(A) Residual Error 2.75 7 .39

SSE(C) Total Total 5 8

Page 22: Psych 5510/6510

22

Thus...

Thus the error of Model A reflects a difference in how the strength of the IV varies across various individuals, or in other words, the error of the model is the interaction between the treatment (IV) and the individual subjects.

Page 23: Psych 5510/6510

23

Full Summary Tablefor the Crossed Design

Source b SS df MS F* PRE

Between S 18.00 7 2.57

Within S 5.00 8 .63 Treatment (IV) .375 2.25 1 2.25 5.73 .45

Error Within Subjects (Treatment x Subjects

Interaction)

2.75 7 .39

Total 23.00 15

The gray cells represent the analysis within subjects, what we just accomplished byusing W scores, which is what we are really interested in. The white cells represent what we lost when we moved to W scores, they are included just to be complete.SSTotal is the SS of all of the Y scores (including two per subject), SSBetweenS isfound by SSTotal – SSWithinS. The same goes for the df.

Page 24: Psych 5510/6510

24

More on Crossed DesignsWhat if we have three levels to our independent

variable and subjects are crossed with this variable?

Group: a1 Group: a2 Group: a3

S1 S1 S1

S2 S2 S2

S3 S3 S3

S4 S4 S4

S5 S5 S5

S6 S6 S6

Page 25: Psych 5510/6510

25

Data

Subject Group: a1 Group: a2 Group: a3

S1 5 7 2

S2 11 14 10

S3 29 30 22

S4 8 8 1

S5 36 42 38

S6 15 17 12

Note large within group variance.

Page 26: Psych 5510/6510

26

With three levels in our independent variable we are going to need two contrasts to completely code it. Let’s say we select:

Contrast 1: (first group vs. other two groups combined)λ11 = -2 λ12 = 1 λ13 = 1

Contrast 2: (second group vs. third group)λ21 = 0 λ22 = -1 λ23 = 1

Page 27: Psych 5510/6510

27

Analyzing Contrast 1Contrast 1: λ11 = -2 λ12 = 1 λ13 = 1

41.112

)2(1)( )7(1)( )5)(2(

112

)(1)(Y )(1)(Y )Y)(2(W

222

222

3211i

iii

Using SPSS you have it compute W1 scores, then analyze themto see if the mean of the W1 scores differs significantly from zero.

Page 28: Psych 5510/6510

28

Data

Subject Group: a1 Group: a2 Group: a3 W1

S1 5 7 2 -.41

S2 11 14 10 .82

S3 29 30 22 -2.45

S4 8 8 1 -2.86

S5 36 42 38 3.27

S6 15 17 12 -.41

Does mean of W1 differ from zero?

Page 29: Psych 5510/6510

29

Contrast 1

726.p 137.05.028

.69

MS

MSF*

028.55

25.14

df

SSE(A)MS

69.01

0.69

df

SSRMS

606PCNdf

516PANdf

10-1PCPAdf

726.p 0267.83.25

69.0

SSE(C)

SSR PRE

25.83 0.6925.14 SSR SSE(A) SSE(C)

14.25)028.5(5) W1of variance(1)-n(scores W theof SSSS SSE(A)

69.0)3402(.6Wn SSR

A Model

reduced

AA Model

reducedreduced

C

A

reduced

1W

22

1

1

Page 30: Psych 5510/6510

30

Contrast 1

Source Source Source SS df MS F* PRE p

SSR Regression Model

(Xi)

0.69 1 0.69 .137 .027 .726

SSE(A) Residual Error 25.14 5 5.028

SSE(C) Total Total 25.83 6

You could simply say PRE (or R²)=.027, p=.726, or you couldexpress it in a summary table as seen below.

Page 31: Psych 5510/6510

31

Analyzing Contrast 2

Contrast 2: λ11 = 0 λ12 = -1 λ13 = 1

54.31)1(0

)2(1)( )7(-1)( )5)(0(

1)1(0

)(1)(Y )(-1)(Y )Y)(0(W

222

222

3212i

iii

Using SPSS you have it compute W2 scores, then analyze themto see if the mean of the W2 scores differs significantly from zero.

Page 32: Psych 5510/6510

32

Data

Subject Group: a1 Group: a2 Group: a3 W2

S1 5 7 2 -3.54

S2 11 14 10 -2.83

S3 29 30 22 -5.66

S4 8 8 1 -4.95

S5 36 42 38 -2.83

S6 15 17 12 -3.54

Does mean of W2 differ from zero?

Page 33: Psych 5510/6510

33

Contrast 2

0004.p 25.671.35

90.79

MS

MSF*

35.15

6.75

df

SSE(A)MS

79.901

90.79

df

SSRMS

606PCNdf

516PANdf

10-1PCPAdf

0004.p 931.54.97

79.90

SSE(C)

SSR PRE

97.54 6.750.799 SSR SSE(A) SSE(C)

75.6)35.1(5) W1of variance(1)-n(scores W theof SSSS SSE(A)

79.90)89.3(6Wn SSR

A Model

reduced

AA Model

reducedreduced

C

A

reduced

1W

22

1

1

Page 34: Psych 5510/6510

34

Contrast 2

Source Source Source SS df MS F* PRE p

SSR Regression Model

(Xi)

90.79 1 90.79 67.25

.93 .0004

SSE(A) Residual Error 6.75 5 1.35

SSE(C) Total Total 97.54 6

You could simply say PRE (or R²)=.931, p=.0004, or you couldexpress it in a summary table as seen below.

Page 35: Psych 5510/6510

35

Biases in Ignoring Nonindependence

Nonindependence

Positive Negative

Nested F* too large F* too small

Crossed F* too small F* too large

All these are taken care of by changing the data until you get justone score per person.

Page 36: Psych 5510/6510

36

Summary

W0 is used to come up with one score that represents (more or less) that subject’s average score. It is used to see how much the subjects differed from each other. Use in nested designs.

W1, W2, etc., are used to measure the difference in the subject’s score across various contrasts (i.e. to see how the subject’s scores differed across various levels of the independent variable). Use in crossed designs.