# Basic example using a two-factors design with the data in compiled format. 
# Ficticious data present frequency of observation classified according
# to Intensity (three levels) and Pitch (two levels) for 6 possible cells.
minimalExample
# performs the omnibus analysis first (mandatory):
w <- anofa(Frequency ~ Intensity * Pitch, minimalExample) 
summary(w)
# execute the simple effect of Pitch for every levels of Intensity
e <- emFrequencies(w, ~ Intensity | Pitch)
summary(e)
# For each Pitch, contrast the three intensities, first
# by comparing the first two levels to the third, second
# by comparing the first to the second level:
w3 <- contrastFrequencies( e, list(
         contrast1 = c(1,  1, -2)/2,
         contrast2 = c(1, -1,  0) )
      )
summary(w3)
# Example using the Landis et al. (2013) data, a 3 x 5 design involving 
# program of care (3 levels) and provider of care (5 levels).
LandisBarrettGalvin2013
# performs the omnibus analysis first (mandatory):
w <- anofa(obsfreq ~ provider * program, LandisBarrettGalvin2013) 
summary(w)
# execute the simple effect of Pitch for every levels of Intensity
e <- emFrequencies(w, ~ program | provider)
summary(e)
# For each Pitch, contrast the three intensities, first
# by comparing the first two levels to the third, second
# by comparing the first to the second level:
w3 <- contrastFrequencies( e, list(
         contrast1 = c(1,  1, -2)/2,
         contrast2 = c(1, -1,  0) )
      )
summary(w3)
Run the code above in your browser using DataLab