1 / 35

Linear Models

Linear Models. Two-Way ANOVA. Example -- Background. Bacteria -- effect of temperature (10 o C & 15 o C) and relative humidity (20%, 40%, 60%, 80%) on growth rate (cells/d ). 120 petri dishes with a growth medium available

lyndseya
Download Presentation

Linear Models

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. Linear Models Two-Way ANOVA

  2. Example -- Background • Bacteria -- effect of temperature (10oC & 15oC) and relative humidity (20%, 40%, 60%, 80%) on growth rate (cells/d). • 120 petri dishes with a growth medium available • Growth chambers where all environmental variables can be controlled. • What is the response variable, factor(s), level(s), treatment(s), replicates per treatment? LM ANOVA 2

  3. Factorial or Crossed Design • Each treatment is a combination of both factors. LM ANOVA 2

  4. Factorial or Crossed Design • Advantages (over two OFAT experiments) • Efficiency – each individual “gives information” about each level of BOTH factors. OFAT LM ANOVA 2

  5. Factorial or Crossed Design • Advantages (over two OFAT experiments) • Efficiency – each individual “gives information” about each level of BOTH factors. • Power – increased due to increased effective n. • Effect Size – detect smaller differences • Interaction effect– can be detected. LM ANOVA 2

  6. Interaction Effect • Effect of one factor on the response variable differs depending on level of the other factor. LM ANOVA 2

  7. No Interaction Effect LM ANOVA 2

  8. Main Effects • Differences in “level” means for a factor • “Strong” relative humidity main effect • “Weak” temperature main effect. 11.25 10.25 6.5 9.5 12.5 14.5 LM ANOVA 2

  9. Main Effects • “Strong” relative humidity main effect • “Weak” temperature main effect. LM ANOVA 2

  10. Interaction Effect LM ANOVA 2

  11. Humidity and Temperature Effects LM ANOVA 2

  12. Humidity Effect Only LM ANOVA 2

  13. Temperature Effect Only LM ANOVA 2

  14. No Effects LM ANOVA 2

  15. Example #1 × Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ √ LM ANOVA 2

  16. Example #2 × Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ × LM ANOVA 2

  17. Example #3 Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ LM ANOVA 2

  18. Example #4 × Interaction Effect Factor 1 Main Effect Factor 2 Main Effect × √ LM ANOVA 2

  19. Example #5 Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ LM ANOVA 2

  20. Example #6 Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ LM ANOVA 2

  21. Example #7 × Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ √ LM ANOVA 2

  22. Example #8 Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ LM ANOVA 2

  23. Example #9 × Interaction Effect Factor 1 Main Effect Factor 2 Main Effect × √ LM ANOVA 2

  24. Example #10 Interaction Effect Factor 1 Main Effect Factor 2 Main Effect √ LM ANOVA 2

  25. Terminology / Symbols • One factor is “row” factor • r = number of levels • Other factor is “column” factor • c = number of levels • Yijk= response variable for kth individual in ithlevel of row factor and jth level of column factor • for simplicity, assume n is same for all i,j LM ANOVA 2

  26. Terminology / Symbols Grand mean Level means Treatment means `Y11. `Y1.. `Y12. `Y1c. `Y21. `Y22. `Y2c. `Y2.. `Yr1. `Yr2. `Yrc. `Yr.. `Y.1. `Y.2. `Y.c. `Y... LM ANOVA 2

  27. 2-Way ANOVA Purpose • Determine significance of interaction and, if appropriate, two main effects. • Are differences in means “different enough” given sampling variability? LM ANOVA 2

  28. 2-Way ANOVA Calculations • MSWithin is variability about ultimate full model • MSTotal is variability about ultimate simple model • if MSAmong is large relative to MSWithin then ultimate full model is warranted • i.e., some difference in treatment means • implies differences due to row factor, column factor, or interaction between the two • SSAmong= SSRow+ SSCol + SSInteraction • If MSRow is large relative to MSWithin then a difference due to the row factor is indicated • Similar argument for column and interaction effects LM ANOVA 2

  29. 2-Way ANOVA Calculations SSAmong = SSRow + SSColumn + SSInteraction LM ANOVA 2

  30. r ( ) 2 å SSRow=cn - Y Y .. ... i = i 1 2-Way ANOVA Calculations c ( ) 2 å SSColumn=rn - Y Y . . ... j = i 1 `Y11. `Y1.. `Y12. `Y1c. `Y21. `Y22. `Y2c. `Y2.. `Yr1. `Yr2. `Yrc. `Yr.. `Y.1. `Y.2. `Y.c. `Y... LM ANOVA 2

  31. Two-Way ANOVA Table Source df SS MS F . Row r-1 SSRowSSRow/[r-1] MSRow/MSWithin Column c-1 SSColSSCol/[c-1] MSCol/MSWithin Inter (r-1)(c-1) SSIntSSInt/[(r-1)(c-1)] MSInt/MSWithin Within rc(n-1) SSWithinSSWithin/[rc(n-1)] Total rcn-1 SSTotal LM ANOVA 2

  32. Example • What is the optimal temperature (27,35,43oC) and concentration (0.6,0.8,1.0,1.2,1.4% by weight) of the nutrient, tryptone, for culturing the Staphylococcus aureus bacterium. Each treatment was repeated twice. The number of bacteria was recorded in millions CFU/mL (CFU=Colony Forming Units). LM ANOVA 2

  33. Review Handout – Example 1 • lm() • anova() • glht() • fitPlot() • addSigLetters() LM ANOVA 2

  34. Assumptions and Checking in R • Same as for the one-way ANOVA LM ANOVA 2

  35. Example • Measured soil phosphorous levels in plots near Sydney, Australia. • Each plot was characterized by type of soil (shale- or sandstone-derived) and “topographic” location (valley, north, south, or hillside). • Data in SoilPhosphorous.txt • Does mean soil phosphorous level differ by soil type or topographic location? • Is there an interaction effect? LM ANOVA 2

More Related