Changes between Version 2 and Version 3 of SOPs/anova
- Timestamp:
- 05/24/13 11:55:46 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SOPs/anova
v2 v3 2 2 3 3 See the [http://www.graphpad.com/support/faqid/1745/ Prism help page] for some general considerations. 4 5 Note that ANOVA and post-hoc tests can be performed in Prism too. 6 4 7 5 8 ==== Reading in Data ==== … … 7 10 8 11 * Use read.* or create appropriate dataframe 9 10 12 11 13 {{{ … … 58 60 }}} 59 61 60 == One-way ANOVA == 62 == Repeated-measures ANOVA == 63 64 Repeated-measures ANOVA is typically needed if multiple measurements are made on the same sample (such as assaying a mouse's weight during a time course). 65 66 == Two-way ANOVA == 67 68 Two-way ANOVA should be used for experiments where to different factors are being varied (such as comparing different treatments of different genotypes of mice). 69 70 ==== Reading in Data ==== 61 71 62 72 73 * Use read.* or create appropriate dataframe 74 75 {{{ 76 # Input data from a tab-delimited text file of the format 77 # weight treatment genotype 78 # 56 a ko 79 # 29 b wt 80 # 60 a wt 81 # ... 82 strains = read.delim("brain_weights.txt",header=TRUE) 83 }}} 84 85 ==== Creating an ANOVA Table ==== 86 * Use the command //anova// or //aov// with summary. The first argument is the dependent variable, followed by ~, and then by independent variable(s). 87 * So if we want to set up a model where weight is a function of the group (e.g., the weight potentially depends on the group) 88 89 {{{ 90 # Syntax 1 91 anova( lm(weight ~ group * genotype, data=strains) ) 92 anova( lm(weight ~ genotype * group, data=strains) ) 93 94 # Syntax 2 95 summary( aov(weight ~ group * genotype, data=strains) ) 96 summary( aov(weight ~ genotype * group, data=strains) ) 97 }}} 98 99 == Post-Test: Comparing All Pairs of Means ==