Changes between Version 2 and Version 3 of SOPs/anova


Ignore:
Timestamp:
05/24/13 11:55:46 (12 years ago)
Author:
gbell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOPs/anova

    v2 v3  
    22
    33See the [http://www.graphpad.com/support/faqid/1745/ Prism help page] for some general considerations.
     4
     5Note that ANOVA and post-hoc tests can be performed in Prism too.
     6
    47
    58==== Reading in Data ====
     
    710
    811  * Use read.* or create appropriate dataframe
    9 
    1012
    1113{{{
     
    5860}}}
    5961
    60 == One-way ANOVA ==
     62== Repeated-measures ANOVA ==
     63
     64Repeated-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
     68Two-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 ====
    6171
    6272
     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# ...
     82strains = 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
     91anova( lm(weight ~ group * genotype, data=strains) )
     92anova( lm(weight ~ genotype * group, data=strains) )
     93
     94# Syntax 2
     95summary( aov(weight ~ group * genotype, data=strains) )
     96summary( aov(weight ~ genotype * group, data=strains) )
     97}}}
     98
     99== Post-Test: Comparing All Pairs of Means ==