D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t...

8
D ay 19 - Chap ter 26 So me details of two-way ANOVA * 0. Sim il ari ty and di ffer ence between one-way and two-way ANOYA • All ANOVA F statistic~ work on the same principle: Compare the variation du~ to the €_ ffect "bcing tested with a _ b e__ nchr, nark leve l of variation that would be present cvC'n if tha.t effect were absent. • 0.1. How many effe cts needs to be tested in ~ne-wa~ ANOVA F test? Ho · /1), == .A)i =-- -- - -= ./lt{K. .1. 1 l'Y' ~i YI e-(i -tt" _ _:±y f ied· e> • 0.2. How many etf ects needs to be tested in (two- ~ ANOVA F test? ---- 3 J 11c>tt~ ::: 2. ,r. o,; , /\ ~- J1Pc -f + 0,1'1 1-flfPr~e -fiP'A . • 0.3. \tVhat is number of treatments and observations in two-way ~NOVA? 1 R> 12. v v..J 2 iN1\""t r C :: Cul u m() f fl-dtlY /vo,.y . 1 2 C n subjects n subjects n subjects n subjects n subjects n subjects n subjects n subjects n subjects n subjects I'/. (_ b p, / !) rr (J) !:._ f {)e r tJYJ. F. I -e )( r, frl.t,rit Y n"t>•'J l ev e C.s G I f'\ {t>-r -hJY · Th e number of levels in row and column variabl es .,_ Y I fl k tJv,} -fa, t> , · Th e number of treatments is :::.: Yx. L,, Th e total number of observations is Y '-1... C. 'f n :::::. tJ • 0.4. \Vhat is number of treatments and observations in one-way ANOVA? :7 I {.-, ) · C~! k- . k... S. }t ,l ll )(.· 11 Ob5 EXAMPLE 26.11 Dietary manipulations in fruit flie~ Reproduction has a high phys io logical cost. A diet rich in proteins can trigger increased reprodu ct ive output in fruit fli es, which we would expect to lead to the depletion of reserves such as body fat. An e xp eriment assessed the percent of body f?,t in female fru it fli es fed one of four diets, three of which were enriched with ye~t (a highprotein food). The exper iment used both wild-type fruit fl ies and mutants with a longer reproducti ve C Vcl e. ) Y /J r ti riJi / ti./ .e,_y. )~ fl Yl'\Ml 1: . . c., .' '(e(}. Sf Cl rY\ O l,•11 i I I S 5 .../ D I w ,r,1 r , _,. 5

Transcript of D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t...

Page 1: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

D ay 19 - Chapter 26

Some details of two-way ANOVA * 0. S im ilarity and difference between one-way and two-way ANOYA

• All ANOVA F statistic~ work on the same principle: Compare the variation du~ to

the €_ffect "bcing tested with a _ be__nchr,nark level of variation that would be present

cvC'n if tha.t effect were absent.

• 0.1. How many effects needs to be tested in ~ne-wa~ ANOVA F test?

Ho · /1), == .A) i =-- -- - -= ./lt{K. .1. 1l'Y' ~i YI e-(i ~ -tt" _ _:±y ~ f ied·e> ~ • 0.2. How many etfects needs to be tested in (two-~ ANOVA F test? ----3 J11c>tt~ ::: 2. ,r.o,; ,/\ ~-J1Pc -f + 0,1'1 1-flfPr~e-fiP'A .

• 0.3. \tVhat is number of treatments and observations in two-way ~NOVA?

1

R> 12. v v..J 2

iN1\""t r

C :: Culum() f fl-dtlY /vo,.y . 1 2 C

n subjects n subjects

n subjects

n subjects n subjects

n subjects

n subjects n subjects n subjects n subjects

I'/. (_ bp, / !) rr (J) !:._ f {)e r tJYJ.F. I -e )( /»r,frl.t,rit

Y n"t>•'J lev eC.s G I f'\ ~ {t>-r -hJY ·

• The number of levels in row and column variables .,_ Y I fl k tJv,} -fa, t> , ·

• The number of treatments is :::.: Yx. L,,

• The total number of observations is Y '-1... C. 'f n :::::. tJ • 0.4. \Vhat is number of treatments and observations in one-way ANOVA?

:7 I {.-, ) · C~! k- . k... M · S. }t ,l ll )(.· 11 Ob5

EXAMPLE 26.11 Dietary manipulations in fruit flie~

Reproduction has a high physiological cost. A diet rich in proteins can trigger increased reproductive output in fruit flies, which we would expect to lead to the depletion of reserves such as body fat. An experiment assessed the percent of body f?,t in female fru it flies fed one of four diets, three of which were enriched with ye~t (a highprotein food). The experiment used both wild-type fru it fl ies and mutants with a longer reproductive CVcle . ) Y /J r ti riJi /ti./ .e,_y. )~ fl Yl'\Ml 1: . . c., .' '(e(}. Sf Cl rY\ Ol,•11 i

I ~ I ~ S 5 .../

D I w ,r,1 r ,_,.

5

Page 2: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

----- ------l~tJ< ';, r I 3 7 I

1. Use One-way ANOVA to analyze t_4_e_q_ata w,'r~ !Jo . . . . -- • \/1' ~ic.11t >Y1V

• .l.l. whats the layout ot one-wny ANOVA? .

vvl w!> w? }Vil /YI~ ni7 \ ---~

?, ~f"Pc7

, C1 > C, u ti r 6 i ,s, 7 CJ g ✓ \;JD }'v l w:'3 w7 )'YID rr11 m-½ n,l ~ ~ ~ !: ~ t _r _r

'P) f'C:., I \

).../ ~ ({ I ::: .A I, .,, . fl g

() / • One-way ANOVA result from Minitab: Percent lipid versus Grolp~

or1<~l,Wi AN rJVf\ 1~ble Source D F· SS · MS F p

Groups· 7 1146.41 160.92 " 38.33 J 0.000 Error 32 <~ ~ §) ~ ~ Total 39 ,1~]5

S = 2.0-!9

• 1.2. How to compute degrees of freedom of "Groups" , "Error" and "Total", respec-ti,·ely? J.J_ . I_[_ L e- I 7

- J4 uf O m,f t , s f.<. == g- . O'l_J C, ::::; · fL -1 ==- ~ ~ :::.

4 1 of vb--s i's N == 4--v o'f1::- ~ N- k- ~ /J,J-- <2'-:::. 5 :2

Tv-lc. 1 .,. 0-j i' S ;V - \ ::: ty{ fei T df I - ~ -) -t N- Jz

y-\ • 1.3. What 's the relationship among some cells?

s j

g C T :::: <;, ~ C7 -I- S: S I.;' SST = S~Q + SSE: total sum

1 of squares = sum of squares for groups + sum of squares

for error. I ) 0 0, l !:-- i I "2 6. ~~ I + ) S '-+. ~__r I (

- (' j (, -I ,// f ·

l\ ISG .= -:-:- ;- &f _f I . )-~~~-l:tf. _ I (; D, (; }-0 ·· r r I

- ·1

\ISE =

2

Page 3: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

• 1.4. How to compute F value?

• 1.5. Summary of one-way ANOVA F test

The one-way AN OVA F test is performed in two stages:

• 1). Divide each sum of squares by its degrees of freedorr_1 to get the mean squares MSG for groups and MSE for error:

• 2). The one-way ANOVA F statistic compares MSG with MSE: f,1 Sh

Jli. f'f, Find the P-value from the F distribution with k - 1 and N - k degrees of freedom.

The ANOVA F statistic for testing the eqality of several means has this form:

F variation among the sample means

variation among individuals in the same sample SSG/dfi MSG SSE/dh MSE.'

where

• SSG: the sum square for Groups,

• SSE: sum square within Groups (error) ,

• MSG: mean square for Groups,

•. MSE: mean square within samples (error),

•~:dfi is degrees of freedom for the numerator: dfi = k - 1, k is number of groups.

---: dh _is degrees of freddom for the ~enomin3:tor: dh = N - k, N is grand sample size.

3

Page 4: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

2 . Use Two-way ANOVA to analyze the data

• 2.1. \I\That 's the layout of two-way ANOVA above?

><.R.,J..s+ ~YYl (TJMl t G -r) ~ 7 /;Vi ii s- r; !' ~

p_ ._ C, e 'Y\,YhJ )::e Y\A 1,1tc;~t s ~ ! s-

• 2.2. 1\vo-way ANOVA result from Minitab: Percent lipid versus Genotype, Yeast ' ').'A 4-. y ::;;). C. ~ 4- -

s_ource DF SS - p

p_ rr'\Vli~ c,fffl"'C'~ Genotype

V yY\v\; 1, Q{f ort ~ east amount {,--y '/.. y I_ntera~tiq_n

l 3 3 32

Q.13 1113:37

0.132 0.03 371. ~22 \ 88.4 4.3 2 LO

0.86 0.000 0.395

Error Total 39

S = 2.049

• 2.3. What does each cell represent for?

elf ,, vr h e, ;1 o·l 8 pC!-

\ 1 \ ) Ye ti\> i

' ) I ' (7~ 'f \ I \ I fr m

\, ' I T,rl t"/

r V 01 l ,,l iv< I I ' )

\ I \ '

~ off I< :::. 1 0ic ~ ~-o{ -f ~c_ ~ :3 -of{f_ =- 3> .

- o( f T .: s,_ C 7-e/M qJ j"J,e. ( I<)

'(Vtd C c. )

),ft +_..,r~r-Jim GJX 'f

.2

\

I ~

' ) s

rs

• 2.4. What 's the relationship among some cells?

4

<;S k_ == OJ~ /0,Sk -:::. U, 1~~

S S C -= I I 11;, s 7 M S l = "3 7 U > >

S.$ /<C.. ::: ).2, 9 / Jv,..SJ2c., ~ lk,s o)

<; S 1 =-- H l/-,-, .r /v.. .5 G =- 4-. 2

S~T =- /2 6vJ !;

V, v~ ' =') p -=--V, ~ 0 <M. l{~_, .::::- ") p.:::. 1) ClVll

/ ; i)) ' :::::;:,/ p = V, ?, q \;

Page 5: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

(1) DJ- , Q ~ <; ' s s T :::: <;;:5 /2_ + C 5 C + ('r,ec_ -t- ~s."E .

(i) ;U~ ' MS/:2.._ -<J <; J<- _ ~~t: t~/2 C d{ k., J JV\<; C- ::. o(f c. J /V-~/2C ~ df ;..c

(P T :

• 2.5. Compared with one-way ANOVA result , what's is similarity?

1) The total sum of squares and the error sum of squares 9-re the samf: as in the one-wa;Y a~ ss1 °' Y' OI ~ s E , fa\~ t · o. re c;:'?'~) ('1 ~flh-t-,ve 18

I I\ (/11-t - w·& ~ 111 -twv-wrv trbvvv A-

2) The sum of squares for groups in one-way is the sum of the three sums of squares for two main effects and an interactlon in two-way. AM> VA

·~56r 1't'\ t71te- W'1} - <;S/2._ + <;_s C.. + ~ <; "}2.c_ ,',,

l I 2. b. 4-1 t-i.vo- wo.8- ANOVI~

/ 1 )-. o. 4-I .. -::::. u, ,; -t II 13 . -?, 7 -t- J.), CJ f

3. Summarize the break-down of the sum squares 0. 1'p( Dr· • 3.1. SST= SSR +SSC+ SSRC + SSE off c, ,·r1 lM~ - way ==- of._fR. -f o/fCJ

total sum of squares sum of squares for main effect of Factor R -+ o-<r P,( .

+ sum of squares for main effect of Factor C + sum of squares for interaction between R and C + sum of squares for error

• 3.2. How to compute degrees of freedom for each source?

- df for main effect of Factor R: r -, ::. ). - I -:: I - df for main effect of Factor C: c - I - £.i., -1 = ~ - df for interaction between R and C: (y -J) ")( cc -•) ::::.- C ::> -, ) J£" ( i - 1 )

5

Page 6: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

- df for error: Y • C, l n, -1 ) :=. ) , Lr · (5-t ) -::. * · 4' :::. 'S.2. '

• 3.3. Relationship among degrees of freedom /J::::. Y·C.·rt.

rcn - l = (r - 1) + (c - 1) + (r - l] (c - 1) + rc(n - 1) = !'1- 1. off T d,f P--. -t df c.. -+ vf f /<.C + olf E . =-- -t-,,1~ elf

total df df for main effect of Factor ~ + df for main effect of Factor Q + df for interaction between R and C + df for error

• 3.4. Divide each sum of squares by its degrees of freedom to get the mean squares for the three effects and for error:

MSR = SSR. MSC= SSC. MSRC = SSRC . MSE = SSE. r-l ' c-1 ' - (r-l)(c-1)' . N-k'

af p. o){~ tx,f/J.c, ~ ti.f 1; .

• 4. Summary of two-way ANOVA F tests

The F statistics for the three types of treatment effects in two-way ANOVA are

• For the main effect of Factor R, F = ~~; with dfs r - l and N - k - 1 P • For the main ~ffect of Factor C, F = ~~~ with dfs c - 1 and N - k -? f • For the interaction of Factor Rand C, F = AJJ:J with dfs (r - l)(c -1) and N - k-:!>~

In all cases, large values of F are evidence against the null hypothesis that t~e eff~ct is not present i.!!Jbe populations.

5. Example

26.12 Hooded rats: social play times, continued.

How does social isolation during a critical development period affect the behavior of hooded rats? Psychology students assigned 24 young female rats at random to either iso­lated or group housing, then similarly assigned 24 young male rats. This is a randomized block design with the gender of the 48 rats as the blocking variable and housipg type as the t reatment. Later, the students observed the rats at play in a gfO!!Q _S~tting and recorded data on three types of behavior (object playl locomotor play, and socia l pl.=iy) .

> X ) -F~ ( 1v'r it- e_ X: p.0r, }YL011 !

f Q W't1,l e_ I~cf?(tJ. ti M 9,nry ") t.J , i: - I. } - (7

I JIY: p, I c?~ J.ti~ -:i /.,., - C, )__ U---- - - - - - -

\1/ T-1 )

I- :_ {-. ·,· )/1-] ~ ;Y -C1 - )

A, ..{,,I ~ . A,J!,, .,,U<p L

Page 7: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

• (a) Explain how the sums of squares from the two-way AN OVA table can be combined to obtain the ~ HOYA sum of sq:uares for the 4 groups (SSG). What is the value of SSG? ·

• (b) Give the degrees of freedom, mean square (MSG) , and F statistic for Jesting for the effect of groups in. the e wayY\-NOVA setting.

• ( c) Is there a significant effect of group on the amount of time spent in play? Give and interpret the P -value in t he.context of this experiment .

.2-W~tl AMJ VA · Source OF ss MS F p

E.&. = p_ Sex 1 11193.5 11193:5 12.85 0.001 F /<. M~ C, Housing 1 623.5 623.5 J).72 0.402

~ f<_:1.. l. Sex*Housing 1 72.5 72.5 0.08 0.774 A,-t,l -

(CA ) SS C1 ss p__ + c~ c + <;: <;,k C- /1A,a. =- r--~

Cb)

r )\ (- l C ( J

/1 \ C, t

{ } 113.S- + 62 ~' !; -t- 7 J_ ' ~ Jv\ ,~( I I 8~1. ~ /v'l~'G

off C7 ' Q)'\Q - wi AJ/'J VI\ = tx f R- + df C + cl f 12- L-11,

o,(~ 0 ~ \--r 1+ I ::: 5 -

~~ {, ) I'S ~'1. r; - -3 1 63 . 16 7 /\/\ SC-, == -

of 1 c--, - 6

M ~C1 j '? 6~. 16 7 /,f\_t-_t- . f-

- -- -- 9:7 h {}8'1S ;:::: /v1 5"f

Ii\ ( 11 (-wA'd ::: /\A~ f / V\ twv - W11~--....

)V\ ~ ( = /v1 5 t- -) Tc. .

=- f-~~

,'n t'wo-l,¼o

Iv= 4&---f- ( }z.-1 , N-/c:) [<. = Y · G t:= .l · 2 = Lr. Afl-

(/."~ . 7

= Ft1.u.r ( ~, 4~) ::: -2 · lS'i 7 \- ~ 4-,~ ~ 7 2 .. ~ / 7 _;:.,')

Page 8: D a y 19 - Chap ter 26 0. S i m ila ri ty and diffe r enc ... · D a y 19 - Chap ter 26 Some d e t a il s of two-way ANOVA * 0. S i m ila ri ty and diffe r enc e between one-way and

26.13 Evolution in bacteria, continued.

Exercise 26.11 gives the F statistics and P -values for the main effects and interaction of

a two-way AN OVA of bacterial relative fitness as a function of evolution pH and test pH.

• ( a) What are the degTees of freedom for each of the three F values? '\ rL ;vt.~,ll c - - - M.$t-

• (b) The mean squares (MSyur evolution pH, test pH, and interaction are 0.927225,

)A._~ Jl.... --:;)0.172978, and 0.107033, respectively. Use this information to fill in the compl_ete

AN OVA tahk_ for the two-way AN OVA test (you can refer to Figure 26.10 for a

f--

modcl). ---

Source F p

Evolution pH 4.38 0.045 Test pH 27.85 <0.001

Interaction 17.23 <0.001

co) 2X3 f °' ( 1rn t1/ 1 Q X /)Q. I/ )'Y\U c- .

~ VIJ I~, ti m {_ {.,, ) l = '.2

/Ir\ 1. ~ 1Jl-l 7, 2 -y :::.:3 .

a e- 1' o( Iv = 4-g Test ;V.o_~•tr?- 1 =--

~ ~ / l,.,

C0t )

j f CY - J ) C c -1 ) - >-- >< I :::. ..2 -{Jl P,,C - ,

<;l(l;n(.j..

E vo/irtim

-res t 2

ss 0 0)7)-

\

c) ' J-'/ /.J,, 0

MS rJ,o'27.2

/J , f o7o

/--~ 38"

21rt'

I/, )_$ I

L J ,u!J)

J r· 1-e ~ r1t' t7J1 2.

7;- '(YV'( 4~ O~ t boS' t),0 ."),1)/ ~-~~ - _

- --~.:---4J,-O-Q.i>-)..--...,---- --- --- ---

To1~1 ____ tJ_ -~1-=_4__:__1 - - -=-0~. _91f-_ g ___ -_ _ _

- ----