2 sstr n sum yfit ybar 2 how can we explicitly avoid

Info icon This preview shows pages 3–5. Sign up to view the full content.

··· ) 2 SSTR = n * sum ((Y_fit - Y_bar) ^ 2 ) How can we explicitly avoid calculating SSAB? SSAB = SSTR SSA SSB SSAB = SSTR - SSA - SSB SSE = sum (e ^ 2 ) SSTO = SSTR + SSE Degrees of freedom df_SSA = a - 1 df_SSB = b - 1 df_SSAB = (a - 1 ) * (b - 1 ) df_SSE = (n - 1 ) * a * b df_SSTO = n * a * b - 1 Mean Square Error MSA = SSA / df_SSA MSB = SSB / df_SSB MSAB = SSAB / df_SSAB MSE = SSE / df_SSE library (knitr) anova.table <- matrix ( c (SSA,SSB,SSAB,SSE,SSTO, df_SSA,df_SSB,df_SSAB,df_SSE,df_SSTO, MSA,MSB,MSAB,MSE, NA ), 5 , 3 ) rownames (anova.table) <- c ( "Factor A" , "Factor B" , "AB Interactions" , "Error" , "Total" ) colnames (anova.table) <- c ( "SS" , "df" , "MS" ) kable (anova.table, digits = 4 ) 3
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Source of SS df MS Variation Factor A SSA = nb q i ( Y i ·· Y ··· ) 2 a-1 MSA = SSA a 1 Factor B SSB = na q j ( Y · j · Y ··· ) 2 b-1 MSB = SSB b 1 AB interactions SSAB = n q i,j ( Y ij · Y i ·· Y · j · + Y ··· ) 2 (a-1)(b-1) MSAB = SSAB ( a 1)( b 1) Error SSE = a q i =1 b q j =1 n q k =1 ( Y ijk Y ij · ) 2 (n-1)ab MSE = SSE ( n 1) ab Total SSTO = a q i =1 b q j =1 n q k =1 ( Y ijk Y ··· ) 2 nab-1 SS df MS Factor A 220.020 2 110.0100 Factor B 123.660 2 61.8300 AB Interactions 29.425 4 7.3562 Error 1.625 27 0.0602 Total 374.730 35 NA Notice the lack of variation attributed to the error, while the factors A,B account for most of the variation, followed by some degree of interaction. (c) Testing for interaction e ff ects H 0 : all ( –— ) ij = 0 vs. H a : not all ( –— ) ij equal zero. F ratio: F ú = MSAB MSE H 0 F ( a 1)( b 1) , ( n 1) ab . Decision rule: Compare F ú with F (1 ; ( a 1)( b 1) , ( n 1) ab ) . #statistic F_star = MSAB / MSE F_star ## [1] 122.2269 #critical value qf (. 95 , df_SSAB, df_SSE) ## [1] 2.727765 #p-value 1 - pf (F_star, df_SSAB, df_SSE) ## [1] 0 Since F ú > F (0 . 95 , 4 , 27) , we reject Ho and conclude there exists an interaction e ff ect between the amounts of active ingredients A and B on the relief time of patients. (d) Testing for main e ff ects (A) H 0 : 1 = · · · = a = 0 vs. H a : not all i ’s equal zero. F ratio: F ú = MSA MSE H 0 F a 1 , ( n 1) ab . Decision rule: Compare F ú with F (1 ; a 1 , ( n 1) ab ) .
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern