1 / 37

More complicated ANOVA models: two-way and repeated measures

More complicated ANOVA models: two-way and repeated measures Chapter 12 Zar Chapter 11 Sokal & Rohlf. First, remember your ANOVA basics………. -Total SS in 1-way ANOVA -Deviations around total mean. 8. 7. 6. 5. Overall mean. Yield (tonnes). 4. 3. 2. Fert 1. Fert 3. Fert 2. 1. 0. 0.

Télécharger la présentation

More complicated ANOVA models: two-way and repeated measures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. More complicated ANOVA models: two-way and repeated measures Chapter 12 Zar Chapter 11 Sokal & Rohlf First, remember your ANOVA basics……….

  2. -Total SS in 1-way ANOVA -Deviations around total mean 8 7 6 5 Overall mean Yield (tonnes) 4 3 2 Fert 1 Fert 3 Fert 2 1 0 0 10 20 30 Plot number

  3. Within group SS= deviations around group means Group means 8 7 6 5 Yield (tonnes) 4 3 2 Fert 1 Fert 3 Fert 2 1 0 0 10 20 30 Plot number

  4. Among groups SS=deviations of group means from overall mean Group means 8 7 6 5 Overall mean Yield (tonnes) 4 3 2 Fert 1 Fert 3 Fert 2 1 0 0 10 20 30 Plot number

  5. Mean squares Combine information on SS and df Total mean squares = total SS/ total df total variance of data set Within group mean squares = within SS/ within df variance (per df) among units given same treatment Error MS Unfortunate word usage Among groups mean squares = among SS / among df variance (per df) among units given different treatments

  6.  The question: Does fitting the treatment mean explain a significant amount of variance? Among groups mean squares F = Within group mean squares Compare calculated F to critical value from table (B4)

  7. If calculated F as big or bigger than critical value, then reject H0 But remember……. H0: m1 = m2 = m3 Need separate test (multiple comparison test) to tell which means differ from which

  8. Factorial ANOVA= simultaneous analysis of the effect of more than one factor on population means -- Effect of light (or music) and water on plant growth -- Effect of drug treatment and gender on patient survival --Effect of turbidity and prey type on prey consumption by yellow perch --Effect of gender and income bracket on # pairs of shoes owned

  9. Two-way ANOVA vs a nested (hierarchical) ANOVA see chapter 10 S& R Example: the effect of drug on quantity of skin pigment in rats. 5 drugs + 1 control= 6 groups (fixed effect) 5 rats per drug 3 skin samples per rat Each sample divided in to 2 lots, each hydrolyzed 2 optical density readings per hydrolyzed sample Random effects

  10. Drug is the main factor of interest All other levels are subordinate Rat1 in drug treatment 1 is not the same as Rat1 in drug treatment 2 Above design is nested. Rats are nested within drug treatment, skin sample is nested within rat etc……. Can be mixed model (as in example) where primary effect is fixed (drug) but subordinate levels are random Or can be completely random model if the levels (eg drugs) were truly a random sample of all possible drugs

  11. Two-way ANOVA, Two-factor ANOVA There must be correspondence across classes --Effect of turbidity level and prey type on prey consumption by yellow perch High and low turbidity must be the same across all prey types Turbidity could be random or fixed Prey type probably always fixed? -- Effect of drug treatment and gender on patient survival Drug treatments must be same for both genders Drug could be random or fixed Gender always fixed?

  12. Terminology --Two factors A and B -- a = number of levels of A; starting with i -- b = number of levels of B; starting with j -- n = number replicates; starting with l -- Each combination of a level of A with a level of B is called a cell -- Cell analogous to groups in 1-way ANOVA --If there are 2 levels of 2 factors analysis called 2 x 2 factorial

  13. cell

  14. b a n Total SS =    (Xijl –X)2 j=1 i=1 l=1 = (all deviations from grand mean)2 Total DF = N-1

  15. Among Cell SS = variability between cell means and grand mean --among cell DF= ab-1 --Analogous to among groups SS in 1-way ANOVA Within Cell SS = deviations from each cell mean --within cell DF = ab (n-1) --analogous to within groups SS in 1-way ANOVA

  16. But……. Goal of 2-way ANOVA is to assess the affects of each of the 2 factors independently of each other --Consider A to be the only factor in a 1-way ANOVA (ignore B) a Factor A SS = bn  (Xi –X)2 i=1 Then --Consider B to be the only factor in a 1-way ANOVA b Factor B SS = an  (Xj –X)2 j=1

  17. Now the tricky part…………… -- Among cell variability usually  variability among levels of A + variability among levels of B -- The unaccounted for variability is due to the effect of interaction -- Interaction means that the effect of A is not independent of the presence of a particular level of B --Interaction effect is in addition to the sum of the effects of each factor considered separately

  18. Grow algae two levels of light and with and without zebra mussels, 15 reps in each cell, N=60 Measure net primary production of the algae (NPP)

  19. We will now graphically examine a range of outcomes of this 2x2 factorial ANVOA Some of the possible outcomes have below. Be prepared to discuss the meaning –ie, your interpretation of the graph with your name on it.

  20. Erin H. No difference of either factor and no interaction Low light 20 High light NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  21. Dave H. Significant main effect of light Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  22. Jhonathon Significant main effect of ZM Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  23. Both main effects are significant, but no interaction Josh S. Anthony Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  24. Significant interaction, but no significant main effect Colin Xiao-Jain Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  25. Interaction and the main light effect are significant Rajan Coleen Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  26. Interaction and the main zm effet are significant Chen-Lin Nan Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  27. the interaction and both main effects are significant Reza Malak Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  28. the interaction and both main effects are significant Chenxi Damien Low light High light 20 NPP (mgO2/m2/2hr) 10 0 With zm Without zm

  29. How to in SAS: Data X; set Y; proc glm; class gender salary; model shoepair=gender salary gender*salary; interaction Main effects

  30. Analysis of covariance (ANCOVA) -Testing for effects with one categorical and one continuous predictor variable -Testing for differences between two regressions -Some of the features of both regression and analysis of variance. -A continuous variable (the covariate) is introduced into the model of an analysis-of-variance experiment.

  31. Initial assumption that there is a linear relationship between the response variable and the covariate If not, ANCOVA no advantage over simple ANOVA

  32. Ex. Test of leprosy drug Variables =                -10 patients selected for each drug) -6 sites on each measured for leprosy bacilli. -Covariate = pretreatment score included in model for increased precision in determining the effect of drugs on the posttreatment count of bacilli.

  33. data drugtest; input Drug $ PreTreatment PostTreatment @@; datalines; A 11 6 A 8 0 A 5 2 A 14 8 A 19 11 A 6 4 A 10 13 A 6 1 A 11 8 A 3 0 D 6 0 D 6 2 D 7 3 D 8 1 D 18 18 D 8 4 D 19 14 D 8 9 D 5 1 D 15 9 F 16 13 F 13 10 F 11 18 F 9 5 F 21 23 F 16 12 F 12 5 F 12 16 F 7 1 F 12 20 ; proc glm; class Drug; model PostTreatment = Drug PreTreatment Drug*PreTreatment/ solution; run; Different way to read in data Define categorical variable Model dependent var=categorical variable covariate and categorical * covariate interaction

  34. First, slopes must be equal to proceed with other comparisons. If interaction term significant- end of test If interaction term not significant can compare intercepts (means) ** use Type III SS

  35. Type I SS for Drug gives the between-drug sums of squares for ANOVA model PostTreatment=Drug. Measures difference between arithmetic means of posttreatment scores for different drugs, disregarding the covariate.

  36. The Type III SS for Drug gives the Drug sum of squares adjusted for the covariate. Measures differences between Drug LS-means, controlling for the covariate. The Type I test is highly significant (p=0.001), but the Type III test is not. Therefore, while there is a statistically significant difference between the arithmetic drug means, this difference is not significant when you take the pretreatment scores into account.

More Related