Advanced ANOVA

58
Anthony Greene 1 Advanced ANOVA 2-Way ANOVA Complex Factorial Designs I. The Factorial Design II. Partitioning The Variance For Multiple Effects III.Independent Main Effects of Factor A and Factor B IV. Interactions

description

Advanced ANOVA. 2-Way ANOVA Complex Factorial Designs The Factorial Design Partitioning The Variance For Multiple Effects Independent Main Effects of Factor A and Factor B Interactions. Total Variability. Effect Variability (MS Between). Error Variability (MS Within). The Source Table. - PowerPoint PPT Presentation

Transcript of Advanced ANOVA

Page 1: Advanced ANOVA

Anthony Greene 1

Advanced ANOVA 2-Way ANOVA

Complex Factorial Designs

I. The Factorial DesignII. Partitioning The Variance For

Multiple EffectsIII. Independent Main Effects of Factor

A and Factor BIV. Interactions

Page 2: Advanced ANOVA

Anthony Greene 2

The Source Table• Keeps track of all data in complex ANOVA

designs• Source of SS, df, and Variance (MS)

– Partitioning the SS, df and MS

– All variability is attributable toeffect differences or error (all unexplained differences)

Total Variability

Effect Variability

(MS Between)

ErrorVariability

(MS Within)

Page 3: Advanced ANOVA

Anthony Greene 3

Partitioning of Variability for Two-Way ANOVA

Total Variability

Effect Variability

(MS Between)

Error Variability

(MS Within)

Factor A Variability

Stage 1 {{Stage 2 Factor B

VariabilityInteraction Variability

Page 4: Advanced ANOVA

4

Source Table for 1-Way ANOVA

Effect VariabilityError Variability

Page 5: Advanced ANOVA

5

2-Way ANOVA

• Used when two variables (any number of levels) are crossed in a factorial design

• Factorial design allows the simultaneous manipulation of variables

A1 A2 A3 A4

B1 A1•B1 A2 • B1 A3 • B1 A4 • B1

B2 A1 • B2 A2 • B2 A3 • B2 A4• B2

Page 6: Advanced ANOVA

6

2-Way ANOVAFor Example: Consider two treatments for mood disorders

1.This design allows us to consider multiple variables2.Importantly, it allows us to understand Interactions among variables

Placebo Prozac Zanex Bourbon

Depression A1•B1 A2 • B1 A3 • B1 A4 • B1

Anxiety A1 • B2 A2 • B2 A3 • B2 A4 • B2

Page 7: Advanced ANOVA

7

2-Way ANOVA

Hypothetical Data:1.You can see that the

effects of the drug depend upon the disorder

2.This is referred to as an Interaction

Placebo Prozac Zanex Bourbon

Depression -2.3 0.2 -1.1 -3.2

Anxiety -2.0 -0.1 1.3 -1.6

-3.5-3.0-2.5-2.0-1.5-1.0-0.50.00.51.01.52.0

Placebo Prozac Zanex Bourbon

DepressionAnxiety

Page 8: Advanced ANOVA

8

Example of a 2-way ANOVA: Main Effect A

Daytime Heart rate

Nighttime Heart rate

No-Meditation 75 62Mediation 74 63

60

65

70

75

80

Daytime Nightime

No MeditationMeditation

Page 9: Advanced ANOVA

9

Example of a 2-way ANOVA: Main Effect B

Daytime Heart rate

Nighttime Heart rate

No-Meditation 75 74Mediation 64 63

60

65

70

75

80

Daytime Nightime

No MeditationMeditation

Page 10: Advanced ANOVA

10

Example of a 2-way ANOVA: Main Effect A & B

Daytime Heart rate

Nighttime Heart rate

No-Meditation 80 71Mediation 71 60

60

65

70

75

80

85

Daytime Nightime

No MeditationMeditation

Page 11: Advanced ANOVA

11

Example of a 2-way ANOVA: InteractionDaytime Heart rate

Nighttime Heart rate

No-Meditation 75 62Mediation 65 63

60

65

70

75

80

Daytime Nightime

No MeditationMeditation

Page 12: Advanced ANOVA

Anthony Greene 12

Partitioning of Variability for Two-Way ANOVA

Total Variability

Effect Variability

(MS Between)

Error Variability

(MS Within)

Factor A Variability

Stage 1 {{Stage 2 Factor B

VariabilityInteraction Variability

Page 13: Advanced ANOVA

Anthony Greene 13

Partitioning of Variability for Two-Way ANOVA

Total Variability

Effect Variability

(MS Between)

Error Variability

(MS Within)

Factor A Variability

Stage 1 {{Stage 2 Factor B

VariabilityInteraction Variability

Numerator for Omnibus F-ratio

Denominator for all F-ratios

Page 14: Advanced ANOVA

Anthony Greene 14

Partitioning of Variability for Two-Way ANOVA

Total Variability

Effect Variability

(MS Between)

Error Variability

(MS Within)

Factor A Variability

Stage 1 {{Stage 2 Factor B

VariabilityInteraction Variability

Numerator for Factor A F-ratio

Denominator for F-ratio

Page 15: Advanced ANOVA

15

Partitioning of Variability for Two-Way ANOVA

Total Variability

Effect Variability

(MS Between)

Error Variability

(MS Within)

Factor A Variability

Stage 1 {{Stage 2 Factor B

VariabilityInteraction Variability

Numerator for Factor B F-ratio

Denominator for F-ratio

Page 16: Advanced ANOVA

16

Partitioning of Variability for Two-Way ANOVA

Total Variability

Effect Variability

(MS Between)

Error Variability

(MS Within)

Factor A Variability

Stage 1 {{Stage 2 Factor B

VariabilityInteraction Variability

Numerator for Interaction F-ratio

Denominator for F-ratio

Page 17: Advanced ANOVA

17

2 Main Types of Interactions

Page 18: Advanced ANOVA

Anthony Greene 18

Simple Effects of An Interaction

0102030405060708090

100

B1 B2 B3 B4

A1A2A3

Page 19: Advanced ANOVA

Anthony Greene 19

Simple Effects of An Interaction

0102030405060708090

100

B1 B2 B3 B4

A1

Page 20: Advanced ANOVA

Anthony Greene 20

Simple Effects of An Interaction

0102030405060708090

100

B1 B2 B3 B4

A2

Page 21: Advanced ANOVA

Anthony Greene 21

Simple Effects of An Interaction

0102030405060708090

100

B1 B2 B3 B4

A3

Page 22: Advanced ANOVA

Anthony Greene 22

Simple Effects of An Interaction

0102030405060708090

100

B1 B2 B3 B4

A1A2A3

Page 23: Advanced ANOVA

Anthony Greene 23

Simple Effects of An Interaction

0102030405060708090

100

B1

A1A2A3

Page 24: Advanced ANOVA

Anthony Greene 24

Simple Effects of An Interaction

0102030405060708090

100

B2

A1A2A3

Page 25: Advanced ANOVA

Anthony Greene 25

Simple Effects of An Interaction

0102030405060708090

100

B3

A1A2A3

Page 26: Advanced ANOVA

Anthony Greene 26

Simple Effects of An Interaction

0102030405060708090

100

B4

A1A2A3

Page 27: Advanced ANOVA

Anthony Greene 27

Page 28: Advanced ANOVA

Anthony Greene 28

Page 29: Advanced ANOVA

Anthony Greene 29

Page 30: Advanced ANOVA

Anthony Greene 30

+

Page 31: Advanced ANOVA

Anthony Greene 31

How To Make the Computations

A1 A2

B1 153

374

B2 254

324

A1 A2 RowTot

B1 TSS

TSS

TB1

B2 TSS

TSS

TB2

ColTot.

TA1 TA2

Page 32: Advanced ANOVA

Anthony Greene 32

A1 A2 RowTotal

B1 TSS

TSS

TB1

B2 TSS

TSS

TB2

ColTotal

TA1 TA2

BAbtwAXB

BAbtwAXB

BB

BB

AA

AA

dfdfdfdfSSSSSSSS

dfNG

nTSS

dfNG

nTSS

1-B) of levels of(number ,

1-A) of levels of(number ,

22

22

Page 33: Advanced ANOVA

Anthony Greene 33

Higher Level ANOVAN-Way ANOVA: Any number of factorial variables may be crossed; for example, if you wanted to assess the effects of sleep deprivation:1. Hours of sleep per night: 4, 5, 6, 7, 82. Age: 20-30, 30-40, 40-50, 50-60, 60-703. Gender: M, FYou would need fifty samples

Page 34: Advanced ANOVA

Anthony Greene 34

Higher Level ANOVA

Mixed ANOVA: Any number of between subjects and repeated measures variables may be crossedFor example, if you wanted to assess the effects of sleep deprivation using sleep per night as the repeated measure:1. Hours of sleep per night: 4, 5, 6, 7, 82. Age: 20-30, 30-40, 40-50, 50-60, 60-703. Gender: M, FYou would need 10 samples

Page 35: Advanced ANOVA

Anthony Greene 35

How to Do a Mixed Factorial DesignTotal

Variability

Effect Variability

(MS Between)

MS Within

Individual Variability

ErrorVariability

Stage 1 {{Stage 2 Factor A

VariabilityInteractionVariability

Factor BVariability

Page 36: Advanced ANOVA

Anthony Greene 36

Two-Way ANOVAAn experimenter wants to assess the simultaneous effects of having breakfast and enough sleep on academic performance. Factor A is a breakfast vs. no breakfast condition. Factor B is three sleep conditions: 4 hours, 6 hours & 8 hours of sleep. Each condition has 5 subjects.

Page 37: Advanced ANOVA

Anthony Greene 37

Two-Way ANOVA

Source d.f. SS MS FBetween 60 Main A 5 Main B A x B 30Within 2Total

Factor A has 2 levels, Factor B has 3 levels, and n = 5 (i.e., six conditions are required and each has five subjects). Fill in the missing values.

Page 38: Advanced ANOVA

Anthony Greene 38

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 Main A 1 5 Main B 2 A x B 30Within 2Total

First the obvious: The degrees freedom for A and B are the number of levels minus 1 . The degrees freedom Between is the number of conditions (6 = 2x3) minus 1.

Page 39: Advanced ANOVA

Anthony Greene 39

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 Main A 1 5 Main B 2 A x B 2 30Within 2Total

The interaction (AxB) is then computed: d.f.Between = d.f.A + d.f.B + d.f.AxB. OR d.f.AxB = d.f.A d.f.B

Page 40: Advanced ANOVA

Anthony Greene 40

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 Main A 1 5 Main B 2 A x B 2 30Within 24 2Total 29

d.f.Within= Σd.f. each cell

d.f.Total = N-1 = 29. d.f.Total= d.f.Between+ d.f.Within

Page 41: Advanced ANOVA

Anthony Greene 41

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 12 Main A 1 5 Main B 2 A x B 2 30Within 24 2Total 29

Now you can compute MSBetween by dividing SS by d.f.

Page 42: Advanced ANOVA

Anthony Greene 42

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 12 Main A 1 10 10 5 Main B 2 A x B 2 30Within 24 2Total 29

You can compute MSA by remembering that FA= MSA MSWithin, so 5 = ?/2. SSA is then found by remembering that MS = SS df,so 10 = ?/1

Page 43: Advanced ANOVA

Anthony Greene 43

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 12 Main A 1 10 10 5 Main B 2 20 10 A x B 2 30 15Within 24 2Total 29

Now SSB is computed by SSA + SSB + SSAxB = SSBetween

MSB = SSB/dfB and MSAxB = SSAxB/dfAxB

Page 44: Advanced ANOVA

Anthony Greene 44

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 12 Main A 1 10 10 5 Main B 2 20 10 A x B 2 30 15Within 24 48 2Total 29

MSWithin=SSWithin/dfWithin, solve for SS.

Page 45: Advanced ANOVA

Anthony Greene 45

Two-Way ANOVA

Source d.f. SS MS FBetween 5 60 12 6 Main A 1 10 10 5 Main B 2 20 10 5 A x B 2 30 15 7.5Within 24 48 2Total 29

Now Solve for the missing F’s (Between, B, AxB). F=MS/MSWithin

Page 46: Advanced ANOVA

Anthony Greene 46

Two-Way ANOVAAn experimenter is interested in the effects of efficacy on self-esteem. She theorizes that lack of efficacy will result in lower self-esteem. She also wants to find out if there is a different effect for females than for males. She conducts an experiment on a sample of college students, half male and half female. She then puts them through one of three experimental conditions: no efficacy, moderate efficacy, and high efficacy. Then she measures level of self-esteem. Her results are below. Conduct a two-way ANOVA. Report all significant findings with α= 0.05.

Page 47: Advanced ANOVA

Anthony Greene 47

Data No Moderate High

Efficacy Efficacy Efficacy

1 4 7Males 3 8 8 0 7 10Females 2 10 16

5 7 134 8 15

Page 48: Advanced ANOVA

Anthony Greene 48

No Moderate HighEfficacy Efficacy Efficacy

1 T=4 4 T=19 7 T=25Males 3 SS=4.6 8 SS=8.6 8 SS=4.7

0 7 10 Tm= 48Females 2 T=11 10 T=25 16 T=44

5 SS=4.6 7 SS=4.7 13 SS=4.7 Tf= 804 8 15Tne=15 Tme=44 The=69

n=3k=6N=18G=128∑x2=1260

Page 49: Advanced ANOVA

Anthony Greene 49

SSbetween

SSbtw = ∑T2/n – G2/N

SSbtw = (42 + 192 + 252 + 112 + 252 + 442)/3 –282/18

SSbtw = 1228-910.2=317.8

Page 50: Advanced ANOVA

Anthony Greene 50

SSsex, SSefficacy, SSinteractionSSsex = ∑T2sex/nsex – G2/NSSsex = (482 + 802)/9 – 910.2SSsex = 56.9

SSefficacy= ∑T2e/ne– G2/NSSefficacy = (152 + 442 + 692)/6 – 910.2SSefficacy = 243.47

SSinteraction = SSbetween – SSsex – SSefficacy

SSinteraction = 317.8-56.9-243.47SSinteraction = 17.43

Page 51: Advanced ANOVA

Anthony Greene 51

SSwithin and SStotal

SSwithin = ∑SS

SSwithin=4.6+8.6+4.7+4.6+4.7+4.7=31.9

SStotal = ∑x2 – (∑x)2/N

SStotal = 1260 – 910.2

SStotal = 349.8

Page 52: Advanced ANOVA

Anthony Greene 52

Degrees Freedom

dfbtw = cells – 1 = k-1

dfsex = rows - 1

dfeff = columns - 1

dfint = dfbtw – dfsex - dfeff

dfwin = Σdfeach cell = dftot-dfbtw

dftot = N-1 = nk-1

Page 53: Advanced ANOVA

Anthony Greene 53

Degrees Freedom

dfbtw = cells – 1 = k-1 = 5

dfsex = rows – 1 = 1

dfeff = columns – 1 = 2

dfint = dfbtw – dfsex – dfeff = dfsex dfeff = 2

dfwin = Σdfeach cell = dftot-dfbtw = 12

dftot = N-1= nk-1= 17

Page 54: Advanced ANOVA

54

Source TableSource SS df MS F Fcrit Between 317.8 Sex 56.9 Efficacy 243.5 Int. 17. 4 Within 31. 9Total 349.8

Page 55: Advanced ANOVA

55

Source TableSource SS df MS F Fcrit Between 317.8 5 Sex 56.9 1 Efficacy 243.5 2 Int. 17. 4 2 Within 31. 9 12 Total 349.8 17

Page 56: Advanced ANOVA

56

Source TableSource SS df MS F Fcrit Between 317.8 5 63.6 Sex 56.9 1 56.9 Efficacy 243.5 2 121.7 Int. 17. 4 2 8.7Within 31. 9 12 2.7Total 349.8 17

Page 57: Advanced ANOVA

57

Source TableSource SS df MS F Fcrit Between 317.8 5 63.6 23.5 F(5,12)=3.11 Sex 56.9 1 56.9 21.4 F(1,12)=4.75 Efficacy 243.5 2 121.7 45.8 F(2,12)=3.88 Int. 17. 4 2 8.7 3.3 F(2,12)=3.88Within 31. 9 12 2.7Total 349.8 17

Page 58: Advanced ANOVA

58

Source TableSource SS df MS F Fcrit Between 317.8 5 63.6 23.5 F(5,12)=3.11 Sex 56.9 1 56.9 21.4 F(1,12)=4.75 Efficacy 243.5 2 121.7 45.8 F(2,12)=3.88 Int. 17. 4 2 8.7 3.3 F(2,12)=3.88Within 31. 9 12 2.7Total 349.8 17

1 main effect for sex2 main effect for efficacy 3 no significant interaction