two way anova 4 uploaded

75
1 Two-Way ANOVA Quantitative Research Methods II EDMS 646 Hong Jiao Fall 2012

Upload: ozell-sanders

Post on 04-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 1/75

1

Two-Way ANOVA

Quantitative Research Methods II

EDMS 646

Hong Jiao

Fall 2012

Page 2: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 2/75

Identify α, 1-α, β, 1-β under different

hypothesis testing (Practice)1. Null hypothesis: H0: μ1- μ2 = 0

Alternative hypothesis: H1

: μ1

- μ2

≠ 0

2. Null hypothesis: H0: μ1- μ2 ≤ 0

Alternative hypothesis: H1: μ1- μ2 > 0

3. Null hypothesis: H0: μ1- μ2 ≥ 0

Alternative hypothesis: H1: μ1- μ2 < 0

Page 3: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 3/75

µ 0 Xcrit

Null distribution

Rejection regionNon-Rejection regionRejection

region

Non-Null distribution

H 0: μ1-μ2 =0 

Page 4: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 4/75

µ 0 Xcrit

µ A

Null distribution Alternative distribution

 Acceptanceregion

Rejectionregion

H 0: μ1-μ2 =<0 

Page 5: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 5/75

µ 0Xcrit

µ A

Non-rejection regionRejection region

Null distribution

 Alternative distribution

H 0: μ1-μ2 =>0 

Page 6: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 6/75

6

Review-One Way ANOVA• The analysis of variance tests for differences between

 –  groups –  individuals

• One can reasonably conclude there is no difference between the means when

 –  the observed F ratio is smaller than the critical value

 – the observed F ratio is greater than the critical value –  the MS-within is smaller than MS-between

 –  the SS-within is greater than SS-between

• Rejection of the null hypothesis in the one-way ANOVAleads to the conclusion that

 –  each population mean is different from every other populationmean

 –  all of the sample means are significantly different

 –  not all population means are equal to each other 

 –  the alternate hypothesis is also rejected

Page 7: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 7/75

7

Outline• Two-way ANOVA

 –  Purpose

 –  Interaction

 –  Model setup

 –  Hypothesis testing

 –  Test statistics

 –  Additivity

 –  Assumptions

 –  Variance decomposition

 –  Types of sum of squares –  SPSS runs

 –  Power analysis

 –  Measures of association

Page 8: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 8/75

8

Scenario 1

A researcher is interested in whether graduatestudents with low, medium, and high IQ

differed in terms of their achievement. He

classified a random sample of 300 graduate

students into low, medium, and high IQ groups

and test them on an achievement test. Which

statistical procedure should the researcher 

employ to answer his research question?

Page 9: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 9/75

9

Scenario 2• A researcher is interested in investigating the effect of different levels of 

familiarity of text and reading perception on the level of students readingcomprehension. To investigate the research question, the researcher randomly selected 25 students and randomly assigns them to one of the four treatment conditions.

• Familiar material which the teacher tells the student is difficult tounderstand (F/D)

• Familiar material which the teacher tells the student is easy tounderstand (F/E)

• Unfamiliar material which the teacher tells the student is difficult tounderstand (UF/D)

• Unfamiliar material which the teacher tells the student is easy to

understand (UF/E)• As a result of experimental mortality, the number of students within each of 

the treatment differs. Following the implementation of the treatments, thestudents’ comprehension of the passage that they read was assessed. Thefour variables in the data file are the reading comprehension scores for the

four groups.

Page 10: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 10/75

10

Reanalyzing Scenario 2• A researcher is interested in investigating the effect of different levels of 

familiarity of text and reading perception on the level of students readingcomprehension. To investigate the research question, the researcher randomly selected 25 students and randomly assigns them to one of the four treatment conditions.

• Familiarity of material• Familiar material

• Unfamiliar material• Easy/difficult told by teacher 

• the teacher tells the student is difficult to understand (F/D)• the teacher tells the student is easy to understand (F/E)

• As a result of experimental mortality, the number of students within each of the treatment differs. Following the implementation of the treatments, thestudents’ comprehension of the passage that they read was assessed. Thefour variables in the data file are the reading comprehension scores for thefour groups.

Page 11: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 11/75

11

Purpose of two-way ANOVA

• Test equality of means related to each of twoIVs

• Test the presence of interaction effects 

 between two IVs• Such effect deals with the relative magnitude

of cell means

Page 12: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 12/75

12

Two-Way ANOVA (2X2)

B Margin Meansof A

1 2

A 1 μ11 μ12 μ1.

2 μ21 μ22 μ2.

MarginMeans of B

μ.1 μ.2 μ..

Page 13: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 13/75

13

Example

• Investigate whether either of 2 factors affects the DV-post

operative recovery rate of children who receive tonsillectomies.• Two IVs:

 –  A: nature of pre-operative program with two levels

• 1). Anxiety reduction

• 2). Procedure orientation

 –  B: time of pre-operative program also with two levels• 1). Early treatment

• 2). Delayed treatment

• Children are randomly assigned to one of the four joint levels of the two IVs.

 –  A=1, B=1: anxiety reduction/early treatment

 –  A=1, B=2: anxiety reduction/delayed treatment

 –  A=2, B=1: procedure orientation/early treatment

 –  A=2, B=2: procedure orientation/delayed treatment

Page 14: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 14/75

14

Use Two-Way ANOVA• Mean post operative recovery rates under two pre-

operative programs –  Main effect A hypothesis: H0: μ1.= μ2. 

• Mean post operative recovery rates under two timeframes for pre-operative programs

 –  Main effect B hypothesis: H0: μ.1= μ.2

• Mean postoperative recovery rates under various four  joint levels of pre-operative program and time of pre-operative program (interaction hypothesis betweentreatments A and B H0: μ jk   – μ j.- μ.k + μ.. =0 for all

levels of j and k.

Page 15: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 15/75

15

Interaction effects

• When the values of the cells means can not be

defined in terms of corresponding marginal

means and grand means μ jk ≠ μ j. + μ.k - μ..

• When the mean differences among the levels of 

one independent variable A differ from one

level of a second independent variable B to

another.

Page 16: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 16/75

16

Presence of InteractionB Margin Means

of A

1 2

A 1 5 7 6

2 3 11 7

MarginMeans of B

4 9 6.5

Difference between the mean of level one of A and level two

of A at level one of B is equal to μ11-μ21=5-3=2

Difference between the mean of level one of A and level two

of A at level two of B is equal to μ12-μ22=7-11=-4

There is interaction.

Page 17: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 17/75

17

 No Presence of InteractionB Margin Means

of A

1 2

A 1 10 2 6

2 11 3 7

MarginMeans of B

10.5 2.5 6.5

Difference between the mean of level one of A and level two of A

at level one of B is equal to μ11-μ21=10-11=-1

Difference between the mean of level one of A and level two of A

at level two of B is equal to μ12-μ22=2-3=-1

Both are equal to difference in marginal means μ1. -μ2. =6-7=-1

Page 18: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 18/75

18

Identification of Main Effects and Interaction Effects-Lomax p88 (2X2)

a c  b e

d f  g h

 A1  A2

B1

B2

 A1  A1  A1

 A1  A1 A1  A1

 A2  A2  A2

 A2  A2 A2 A2

B1B1

B1

B1

B1

B1 B1

B2

B2B2

B2B2 B2 B2

Page 19: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 19/75

19

Types of Interaction

B

1 2 3

A 1 10 30 52 30 90 25

Mean at level one of A is smaller than the mean at level two of A

for each of the levels of B- the order of the difference are the sameAt level one of B: 10<30

At level two of B: 30<90

At level three of B: 5<25

1. Ordinal interaction: the order of the mean magnitude on one

IV does not change across the various levels of the 2nd IV

Page 20: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 20/75

20

Graphical representation of ordinal interaction

Ordinal Interactio

0

20

40

60

80

100

B1 B2 B3

IV - B

      D      V   -      A A1

 A2

Page 21: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 21/75

21

Types of Interaction

B

1 2 3

A 1 10 70 20

2 30 50 40

Mean at level 1 of A is smaller than the mean at level 2 of A for 

level 1 and 3 of B but there is a reversal in the order of mean

magnitude for level 2 of B

At level one of B: 10<30

At level two of B: 70>50

At level three of B: 20<40

2. Disordinal interaction: the order of the mean magnitude on

one IV changes across the various levels of the 2nd IV

Page 22: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 22/75

22

Graphical representation of disordinal interaction

0

10

20

30

40

50

6070

80

B1 B2 B3

     D     V

   -     A

IV - B

Disordinal Interaction

 A1

 A2

Page 23: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 23/75

23

Graphical representation of disordinal interaction

Change from Disordinal to Ordinal Interaction

0

10

20

30

40

50

60

70

80

 A1 A2

IV-A

     D

B1

B2

B3

IV, which is placed on the baseline in the graph may affect

whether the line segments cross.

If variable A is put on the baseline, the interaction changed

from disordinal to ordinal

Page 24: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 24/75

24

Which IV should be placed on the baseline of the

graph for describing the interaction effects?

• If both IV are manipulated variables, either IV

may be appropriately be placed on the baseline

• If one of the IVs is not a manipulated variablesuch as gender, the non-manipulated IV should

 be placed on the baseline of the graph

• Factor with most levels put on x axis

Page 25: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 25/75

25

 No InteractionB Margin

Means of A

1 2 3

A 1 40 20 60 40

2 70 50 90 70

Margin

Means of B

55 35 75 55

Page 26: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 26/75

26

 No Interaction

If there is no interaction, graphs of cell means will result in parallel

line segments, no matter which IV is placed on the baseline

Every cell mean may be defined in terms of its marginal means and

the grand mean: μ  jk = μ j. + μ.k - μ..

μ 11= μ1. + μ.1- μ.. =40+55-55=40

μ 12= μ1. + μ.2- μ.. =40+35-55=20

μ 13= μ1. + μ.3- μ.. =40+75-55=60

μ 21= μ2. + μ.1- μ.. =70+55-55=70

μ 22= μ2. + μ.2- μ.. =70+35-55=50

μ 23= μ2. + μ.3- μ.. =70+75-55=90

Page 27: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 27/75

27

Graphical representation of no interaction

No Interactio

0

20

40

60

80

100

B1 B2 B3

IV - B

      D      V   -      A A1

 A2

Page 28: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 28/75

28

Categories of two-way ANOVA

• Two-way factorial ANOVA:

 – Both IVs are manipulated by the researcher 

• Two-way randomized blocks ANOVA:

 – One of the IVs is not manipulated by the

researcher.

 – The non-manipulated IV is called blockingvariable

h A O A

Page 29: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 29/75

29

Why use two-way ANOVA

instead of two one-way ANOVA?

• Possible to increase power by reducing error variance –  Score variability on DV with cells will be less than the

score variability within each row or column

•Economy of efforts –  Simultaneous consideration of two IVs with the same

subjects is more economical than using separate samplesof subjects for each IV

• Possible to investigate interaction effects which can

not be assessed with one-way ANOVA• When on IV is a blocking variable, may be able to

increase the level of comparability of subjectsacross the levels of the manipulated IV

Page 30: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 30/75

30

Notations used in Two-Way ANOVA

IV B

1 2 … K •  jn  •  jY    •  j µ   

1

111Y   

211Y   

1111nY   

112Y   

212Y   

1212nY   

k Y 11 

k Y 21  

k n k Y  11

 •1n   •1Y   

•1 µ   

2

1 2 1Y   

221Y   

2121nY   

122Y   

222Y   

2222nY    Cell(j,k)

k Y 12  

k Y 22  

k n k Y  22   •.2n   •2Y    •2 µ   

ijk Y   

  jk Y   

  jk  µ   

2

  jk σ   

  jk n  

IV A

J

11 J Y   

12 J Y   

11 J n J Y   

21 J Y   

22 J Y   

22 J n J Y   

 Jk Y 1  

 Jk Y 2  

 Jk n Jk Y   

• J n  

• J Y   • J 

 µ   

k n•  1•

n   2•n    K n•   N

k Y •  

1•Y    2•Y    K Y •   ••Y   

k • µ   1• µ   

2• µ    K •

 µ   ••

 µ   

Page 31: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 31/75

31

ijk  jk k  jijk Y  ε αβ β α  µ  ++++= •••• )(

where• Y ijk  is the score for the ith experimental unit in the jk th

treatment combination,•  µ.. is the grand mean of the scores,

•  α j. is the treatment effect of the jth level of the first factor,•  β.k  is the treatment effect of the k th level of the second

factor,

• (αβ) jk  is the interaction effect of α. j and βk ., and

•  εijk  is the error effect for Y ijk . εijk ~ N (0, σ2

ε).

i = (1, …. , n); j = (1, … , J ); k = (1, …. , K )

Two-way ANOVA model

Page 32: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 32/75

32

 jk ijk ijk  Y  µ ε  −=

 µ  µ  µ  µ αβ  +−−= •• k  j jk  jk )(

•••• −= µ  µ β  k k 

•••• −= µ  µ α   j j

Computationally

• Usually, both α j and βk are fixed effects.

• Accordingly, (αβ) jk  is a fixed effect as well.

St ti ti l H th i T ANOVA

Page 33: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 33/75

33

Statistical Hypotheses in Two-way ANOVA

1. Marginal means of A are equal,

H0: μ1.= μ2. =, …, = μJ. or  H 0: α1 = α2 = …. = α j = 0 for all j

H1: μ j. ≠ μ j.’ for at least one pair of levels of A

Or  H 1: α j 0 for at least one  j .

2. Marginal means of B are equal,

H0: μ.1= μ.2 =, …, = μ.K  or  H 0: β1 = β2 = …. = βk  = 0 for all k 

H1: μ.k ≠ μ.k ’ for at least one pair of levels of B

Or  H 1: β.

k ≠ 0 for at least one k .

3. Cell means may be defined in terms of marginal means and grand means,

H0: μ jk.= μ j. + μ.k - μ.. for all j, k  

 H 1: μ jk. ≠ μ j. + μ.k - μ.. for at least one cell jk 

H0: μ jk.- μ j. - μ.k + μ.. =0 for all j and k  

 H 1: μ jk. -μ j. - μ.k +μ.. ≠ 0 for at least one cell jk 

H0: (αβ) jk.= 0 for all j and k  

 H 1: (αβ) jk ≠. 0 for at least one cell jk 

Page 34: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 34/75

34

Expected values of Mean Squares in Two-way ANOVA

1)( 1

2

2

−+=

∑=

 J 

n

 MS  E 

 J 

  j

  j  j

 A

α 

σ ε 

1)(1

2

2

−+=

∑=

 K 

n

 MS  E 

 K 

k k 

 B

β 

σ ε 

)1)(1(

)(

)(1

2

12

−−

+=∑∑

= =

 K  J 

n

 MS  E 

 J 

  j

  jk   jk 

 K 

 AB

αβ 

σ ε 

2)( ε σ =with MS  E 

Page 35: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 35/75

35

F -statistic for testing different hypotheses

with

 A

 MS 

 MS  F =

1. Main effect A

Used for assessing H0: α j=0 for all j

2. Main effect B

with

 B

 MS 

 MS  F = Used for assessing H0: βk =0 for all k 

3. Interaction effect AB

with

 AB

 MS 

 MS  F = Used for assessing H0: (αβ) jk =0 for all j, k 

Page 36: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 36/75

36

Elements in F statistics

Assessed effects df Sum of Squares Mean Squares

Main Effect A

Main effect B

Interaction AB

Within cell

Total

 Adf  

withdf 

 ASS 

 BSS 

total df  total SS 

 Bdf  

 ABdf   ABSS 

withSS 

 A MS 

 B MS 

total  MS 

with MS 

 AB MS 

Page 37: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 37/75

37

Definitional formulas for the elements in F statistics

1−= J df   A

 JK  N df  with −=

2

1

)(

∑=••••

−= J 

 j j j A

Y Y nSS 

1−= N df  total 

1−= K df   B

)1)(1( −−= K  J df   AB

2

1

)(∑=

•••• −= K 

k k  B Y Y nSS 

2

11

)(∑∑=

••••

=

+−−= J 

 j

k  j jk  jk 

 K 

 AB Y Y Y Y nSS 

2

1 11

)(∑∑∑= ==

−= J 

 j

 jk ijk 

n

i

 K 

with Y Y SS  jk 

2

1 11

)(∑∑∑=

••

==

−= J 

 j

ijk 

n

i

 K 

total  Y Y SS  jk 

Page 38: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 38/75

38

• Sum of squares and degree of freedoms are additive

when n jk =n j’k’ for all j, j’, k, k’ or more generally

when the cell sample sizes are the same or 

 proportional.

• Cell sample sizes are proportional when

n jk =(n j.*n.k )/N for all j, k total with AB B A SS SS SS SS SS  =+++

total with AB B A df  df  df  df  df   =+++

However, when the cell sample sizes are not proportional, the

additivity will not hold for sums of squares

 No independence among sums of squares. Thus, F statistics are

not independent of one another.

Page 39: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 39/75

39

 Necessary conditions required for SSA,

SSB, and SSAB to be independent

• The number of elements in each cell, n jk ,

must be proportional by row and bycolumn, or the relative magnitude of 

corresponding cell sample sizes must be thesame, or proportionality is present if andonly if 

• n jk =(n j.*n.k )/N for all j,k 

• When all the cell sizes are equal, this is aspecial case in which proportionality is present

Page 40: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 40/75

40

B

1 2

A 1 n11=5 n12=20 n1.=25

2 n21=20 n22=80 n2.=100

3 n31=15 n32=60 n3.=75

n.1=40 n.2=160 N=200

Proportional cell sample sizes

B

1 2

A 1 n11=15 n12=20 n1.=35

2 n21=5 n22=70 n2.=75

3 n31=20 n32=70 n3.=90

n.1=40 n.2=160 N=200

when proportionality is present or not present

Disproportional cell sample sizes, n jk 

n32=(75*160)/200=60 n32≠(90*160)/200

SStotal ≠ SSA+SSB+SSAB+SSwith

Because these terms are not independent

SStotal=SSA+SSB+SSAB+SSwith

Page 41: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 41/75

41

Assumptions for Two-way ANOVA

1. Observations on DV are random and independent both

within and across treatments• F-test is not robust to violation of this assumption

2. For each joint level of IVs A and B, scores on the DV is

normally distributed

•  F -test is robust to the violation of this assumption if the

sample size for each cell is large, n jk ≥20 for all j, k, or with

 balanced or nearly balanced design

3. For each joint level of IVs A and B, scores on the DV

have equal variance-homogeneity of variance•  H 0: σ11

2 = σ122 = …. = σ jk 

2 = σε2

• Robust if the sample sizes for each cell are equal or nearly

equal or with large n

Page 42: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 42/75

42

Example 1-one way ANOVA:

 –  Research interest: investigating whether three different behavior modification techniques differ in terms of their effectiveness for 

reducing the level of ‘acting out’ behavior manifested byhyperactive children.

 –  Three modification procedures:• Punishment

•  Negative reinforcement

• Positive reinforcement

 –  To investigate the research question, the researcher randomlyselected 12 hyperactive children who are having problems with‘acting out’ behavior and randomly assigned 4 to each of thethree behavior modification treatment regimens

 –  Following the implementation of the treatment which lasted for 6 weeks, the researcher observed the amount of ‘acting out’

 behavior which each child manifested during a 3 hour controlled observation period

Page 43: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 43/75

43

Example 1-Two Way ANOVA: –  Research interest: investigating whether three different behavior modification

techniques and difference in child age differ in terms of their effectiveness for reducingthe level of ‘acting out’ behavior manifested by hyperactive children.

 –  Variable A: Three modification procedures:

Level 1: Positive reinforcement

Level 2: Negative reinforcement

Level 3: Punishment

 –  Variable B: Age of child

Level 1: four years of age

Level 2: eight years of age

 –  To investigate the research question, the researcher randomly selected 12 hyperactivechildren who are having problems with ‘acting out’ behavior and randomly assigned 4to each of the three behavior modification treatment regimens based on their age levels

 –  Following the implementation of the treatment which lasted for 6 weeks, the researcher observed the amount of ‘acting out’ behavior which each child manifested during a 3

hour controlled observation period

Page 44: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 44/75

44

Data layout

IV B

1 2 • jn  

• jY   

1

01

5.011 =Y   

12

5.112 =Y    4 •1Y  =1

2

21

5.121 =Y   

12

5.122 =Y    4 •2Y  =1.5IV A

3

33

0.331 =Y   

44

0.432 =Y    4 • J Y  =3.5

k n•   6 6 N=12

k Y •  1•Y  =1.667 2•Y  =2.333 ••Y  =2

Computation of the statistics

Page 45: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 45/75

45

Computation of the statistics

2131 =−=−= J df   A

62312=×−=−=

JK  N df  with

14)25.3(4)25.1(4)21(4

)(

222

2

1

=−+−+−=

−= ∑=

••••

 J 

 j

 j j A Y Y nSS 

111121 =−=−= N df  total 

121 −=−= K df   B

2)12)(13()1)(1( =−−=−−= K  J df   AB

333.1)2333.2(6)2667.1(6

)(

22

2

1

=−+−=

−=∑=

••••

 K 

k k  B Y Y nSS 

667.0)2333.25.34(2)2667.15.33(2

)2333.25.15.1(2)2667.15.15.1(2)2667.115.1(2

)2667.115.0(2)(

22

222

2

2

11

=+−−++−−+

+−−++−−++−−+

+−−=+−−= ∑∑=

••••

=

 J 

 j

k  j jk  jk 

 K 

 AB Y Y Y Y nSS 

2)44()44()5.12(

)5.11()5.12()5.11()33()33()5.11(

)5.12()5.01()5.00()(

222

222222

222

2

1 11

=−+−+−+

−+−+−+−+−+−+

−+−+−=−= ∑∑∑= ==

 J 

 j

 jk ijk 

n

i

 K 

with Y Y SS  jk 

18)24(2)22()21()22()21()23(2

)21()22()21()20()(

222222

2222

2

1 11

=−+−+−+−+−+−+

−+−+−+−=−= ∑∑∑=

••

==

 J 

 j

ijk 

n

i

 K 

total  Y Y SS  jk 

Page 46: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 46/75

46

ANOVA Summary Table

Source df SS MS F-observed F-critical Sig

 

A 2 14 7 21 .99F2,6=10.92 0.002

B 1 1.333 1.333 4 .99F1,6=13.75 0.092

AB 2 0.667 0.333 1 .99F2,6=10.92 0.422

Within 6 2 0.333

Total 11 18

Page 47: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 47/75

47

Finding Critical Statistics

• df for numerator • df for denominator 

• Significance level

• F table – Lomax Page 472

Page 48: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 48/75

48

Making decision

• Compare F-observed and F-critical – Reject the null when F-observed is equal to

larger than F-critical

 – Otherwise fail to reject the null• Use Sig. value

 – Reject a null when the Sig value is equal to or 

smaller than α

Page 49: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 49/75

49

Decision for the example

• Reject the null for the main effect for variable A because –  F-observed=21, > F-critical=10.92 –  Sig=0.002, < 0.01

 –  Rejections implies that at least two of the marginal

means of IV A differ from each other  –  The population marginal means of acting out behavior 

differ for at least two types of behavior modificationreinforcement procedures

 –  Can not tell which of these three population means differ 

 based on the F test• Fail to reject the null for main effect B and

interaction between A and B

I i f l

Page 50: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 50/75

50

Interpretation of results•  No significant interaction effects,

 –  main effects are additive –  Main effects are statistically independent of one another 

 –  Can make a statement about the constant added benefitsof A1 over A2 regardless of the levels of B

• Significant interaction effects, –  main effects are not additive –  Main effects are not statistically independent of one

another 

 –  Warning one can not generalize statements about a maineffect for A over all levels of B

 –  Can not make a blanket statement about the constantadded benefits of A1 over A2, because relationshipamong the levels of factor A depends on the level of factor B

Comparison of statistics for one-way and two-way

Page 51: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 51/75

51

p y y

ANOVA

Source df Sum of Squares Mean Squares F

Between groups 2 14 7 15.75

Within groups 9 4 0.4444

Total 11 18

Source df SS MS F-observed

A 2 14 7 21

B 1 1.333 1.333 4

AB 2 0.667 0.333 1

Within 6 2 0.333

Total 11 18

Comparison of statistics for one-way and two-way

Page 52: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 52/75

52

ANOVA

Sum of Squares

One-way Two-waySS betw = SSA

=with

 AB

 B

with

SS SS 

SS 

SS 

SStotal = SStotal 

SS-within for two-way ANOVA is often smaller than that for one-way

ANOVA.

The larger the difference, the greater the relative power of the two-way

ANOVA for testing the hypothesis regarding the main effect A

Page 53: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 53/75

53

Comparison of statistics for one-way and two-way

ANOVADegree of freedom

One-way Two-waydf  betw = df A

=with

 AB

 B

with

df  df  

df  

df  

df total = df total 

df-within for one-way ANOVA is always larger than that for two-wayANOVA. This affects both the magnitude of MS-within and the critical

value of F.

The larger the difference, the greater the relative power of the two-way

ANOVA for testing the hypothesis regarding the main effect A

Page 54: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 54/75

54

Type of Sum of Squares How A Main Effect is Tested How B Main Effect is Tested How AB Interaction is Tested

Type I Alone Controlling for  A Controlling for  A and B

Type II Controlling for  B Controlling for  A Controlling for  A and B

Type III Controlling for  B and AB Controlling for  A and AB Controlling for  A and  B

Type IV Controlling for  B and AB Controlling for  A and AB Controlling for  A and  B

• Type I SS should only be used in circumstances where theeffects can be ordered in terms of importance.

• In Type II SS, the interaction is tested first. Only if theinteraction is NOT significant can one go on to test the maineffects.

• Type III SS is always recommended because its control of 

interaction effects in testing main effects• Type IV SS is recommended when there are missing values

in some cells

Properties for each sums of squares

Page 55: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 55/75

55

Properties for each sums of squares

1. The values for SSAB and SSwithin are the same for the four 

different types of sums of squares. Thus the values of theF-statistics for interaction will be the same

2. Whenever all cell sample sizes are proportional

• SS-Type I = SS-Type II

• SS-Type III = SS-Type IV

3. Whenever all cell sample sizes are equal

• All 4 types of SS are the same

• Main effect hypotheses that are tested deal with

unweighted population means

T ANOVA l d l

Page 56: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 56/75

56

Two-way ANOVA: example data layout

T ANOVA l d l

Page 57: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 57/75

57

Two-way ANOVA: example data layout

T ANOVA l d t l t

Page 58: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 58/75

58

Two-way ANOVA: example data layout

Between-S ubjects Factors

4

4

4

age 4 6age 8 6

1.00

2.00

3.00

mod_A

1.002.00

age_B

Value Label N

Descriptive Statistics

Dependent Variable: act_out

.5000 .70711 2

1.5000 .70711 2

1.0000 .81650 4

1.5000 .70711 2

1.5000 .70711 2

1.5000 .57735 4

3.0000 .00000 2

4.0000 .00000 23.5000 .57735 4

1.6667 1.21106 6

2.3333 1.36626 6

2.0000 1.27920 12

age_B

age 4

age 8

Total

age 4

age 8

Total

age 4

age 8Total

age 4

age 8

Total

mod_A

1.00

2.00

3.00

Total

Mean Std. Deviation N

T ANOVA l d t l t

Page 59: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 59/75

59

Two-way ANOVA: example data layout

Estimated Marginal Means

1. mod_A

Dependent Variable: act_out

1.000 .289 .294 1.706

1.500 .289 .794 2.2063.500 .289 2.794 4.206

mod_A1.00

2.003.00

Mean Std. Error Lower Bound Upper Bound

95% Confidence Interval

2. age_B

Dependent Variable: act_out

1.667 .236 1.090 2.243

2.333 .236 1.757 2.910

age_B

age 4

age 8

Mean Std. Error Lower Bound Upper Bound

95% Confidence Interval

3. mod_A * age_B

Dependent Variable: act_out

.500 .408 -.499 1.499

1.500 .408 .501 2.499

1.500 .408 .501 2.499

1.500 .408 .501 2.499

3.000 .408 2.001 3.999

4.000 .408 3.001 4.999

age_Bage 4

age 8

age 4

age 8

age 4

age 8

mod_A1.00

2.00

3.00

Mean Std. Error Lower Bound Upper Bound

95% Confidence Interval

T ANOVA l t t

Page 60: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 60/75

60

Two-way ANOVA: example outputTests of Between-Subjects Effects

De pe nd en t Var iab le: act_o ut

16.000a 5 3.20 0 9 .6 0 0 .0 0 8

4 8 .0 00 1 4 8 .0 0 0 1 44 .0 00 .0 0 0

1 4 .0 00 2 7 .0 0 0 21 .0 0 0 .0 0 21 .333 1 1 .333 4 .0 0 0 .0 9 2

.66 7 2 .333 1 .0 0 0 .422

2.00 0 6 .333

6 6 .0 00 12

1 8 .0 00 1 1

Source

Corre cted Mode l

Intercept

mo d _ Aa g e _ B

mod_A * age_B

Error  

Total

Co rrected Tota l

Typ e III Su m

o f Sq u a re s d f Mea n Squ a re F S ig .

R Sq uare d = .889 (Ad justed R Squa red = .796)a .

T ANOVA l d t l t

Page 61: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 61/75

61

Two-way ANOVA: example data layout

T ANOVA l d t l t

Page 62: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 62/75

62

Two-way ANOVA: example data layout

G*P M i Eff t df J 1

Page 63: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 63/75

63

G*Power-Main Effect df=J-1

G*Power-Interaction Effect df=(J-1)(K-1)

Page 64: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 64/75

64

G Power Interaction Effect df (J 1)(K 1)

Page 65: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 65/75

65

Measure of Association

Effect Size

Two way ANOVA

Page 66: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 66/75

66

• Dependent variable: Attitude toward minority group following

the course.• Factor A: Type of beat ( J = 3)

1 = upper class; 2 = middle class; 3 = inner city• Factor B: Length of the course ( K = 3)

1 = 5 hours; 2 = 10 hours; 3 = 15 hours

Data Summary:

1 2 3 mean

1 33.00 35.00 38.00 35.33

2 30.00 31.00 36.00 32.33

3 20.00 40.00 52.00 37.33

mean 27.67 35.33 42.00 35.00

Factor B

Factor A

Two-way ANOVA

Page 67: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 67/75

67

• ANOVA table

S S d f M S F p - va l u

A 1 9 0 . 0 0 0 2 9 5 . 0 0 0 1 . 5 2 0 . 2 3 2

B 1 5 4 3 . 3 3 3 2 7 7 1 . 6 6 61 2 . 3 5 0 . 0 0 0A x B 1 2 3 6 . 3 3 3 4 3 0 9 . 1 6 74 . 9 5 0 . 0 0 3

W i t h i n c e l l2 2 5 0 . 0 0 03 6 6 2 . 5 0 0

T o t a l 5 2 2 0 . 0 0 04 4

Effect Sizes for two way ANOVA design

Page 68: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 68/75

68

Effect Sizes for two-way ANOVA design

(assume α and β are fixed effects)

nK 

 MS  MS  J  with A J 

 j

 j

))(1(ˆ

1

2 −−=∑

=

α 

For the effect of each factor, use

nJ 

 MS  MS  K  with B K 

))(1(ˆ

1

2 −−=∑

=

β 

n

 MS  MS  K  J  with AB J 

 j

 jk 

 K 

))(1)(1()(

1

2

1

−−−=∑∑= =

αβ 

Page 69: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 69/75

69

333.415

65

)3(5

)5.620.95)(13(ˆ

1

2==

−−=∑

=

 J 

 j

 jα 

56.94)3(5

)5.62667.771)(13(ˆ

1

2=

−−=∑

=

 K 

k β 

33.1975

)5.62167.309)(13)(13()(

1 1

2 =−−−=∑∑= =

 J 

 j

 K 

 jk αβ 

Effect Size (partial omega-squared)

Page 70: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 70/75

70

Effect Size (partial omega-squared)

02.03/333.45.62

3/333.4

/ˆˆ

ˆ

1

22

1

2

2=

+=

+

=

=

=

 J 

 j

 j

 J 

 j

 j

 A

 J 

 J 

α σ 

α 

ω 

ε 

34.03/56.945.62

3/56.94

/ˆˆ

ˆ

1

22

1

2

2 =+

=+

=

=

= K 

 K 

 B

 K 

 K 

β σ 

β 

ω 

ε 

26.0)3(3/33.1975.62

)3(3/33.197

/)(ˆ

/)(

ˆ

1 1

22

1 1

2

2=

+=

+

=

∑∑

∑∑

= =

= =

 J 

 j

 K 

 jk 

 J 

 j

 K 

 jk 

 AB

 JK 

 JK 

αβ σ 

αβ 

ω 

ε 

22

22

α ε 

α 

σ σ 

σ ω 

+=

Simplified formula for estimating ω2 for two-way ANOVA

Page 71: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 71/75

71

p g y

Cohen’s guidelines:

ω 2 = 0.010 is a small association

ω 2 = 0.059 is a medium association

ω 2 = 0.138 is a large association

withtot 

withbet 

 MS SS 

 MS  J  SS 

+

−−=

)1(ˆ 2ω  

withtot 

with A A

 MS SS 

 MS  J  SS 

+

−−=

)1(ˆ 2ω  

withtot 

with B B

 MS SS 

 MS  J  SS 

+

−−

=

)1(ˆ 2ω  

withtot 

with AB AB

 MS SS 

 MS  J  SS 

+

−−

=

)1(ˆ 2ω  

Page 72: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 72/75

72

Highlights• Interaction

• Variance decomposition compared with one-way

ANOVA

d i bl l

Page 73: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 73/75

73

Dependent Variable: Current Salary

Source Sum of  Squares

df Mean Square F

Gender ? 1 110 11

Degree ? 3 250 ?

Gender *Degree

300 ? ? ?

Error ? 45 ?

D d V i bl C S l

Page 74: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 74/75

74

Dependent Variable: Current Salary

Source Sum of  Squares

df Mean Square F

Degree ? 3 250 ?

Error ? 45 ?

Page 75: Two Way ANOVA 4 Uploaded

7/31/2019 Two Way ANOVA 4 Uploaded

http://slidepdf.com/reader/full/two-way-anova-4-uploaded 75/75