Hello everyone,

I've conducted a Type III repeated-measures ANOVA using Anova() from the
car package, based on the suggestions at
http://blog.gribblelab.org/2009/03/09/repeated-measures-anova-using-r/(option
3) and
http://languagescience.umd.edu/wiki/EEG#ERP_ANOVA_in_R. My ANOVA has two
factors: Condition (3 levels) and Region (6 levels) and their interaction.
Below is code to run the Anova and get the model object (the data are at
https://docs.google.com/open?id=0B6-m45Jvl3ZmOVFTYVpZYV9sUUk).


data <- as.matrix( read.table( file="EEGpriming.txt", header=T, sep="\t") )

Condition <- c( rep("Cond1", 6), rep("Cond2", 6), rep("Cond3", 6) )
Region <- factor( rep( c("la", "ma", "ra", "lp", "mp", "rp"), 3 ) )

library(car)

model.Anova <- Anova( lm(eeg ~ 1), idata=data.frame(Condition, Region),
idesign=~Condition*Region ) )

I'm now trying to do post-hoc comparisons between all levels of Condition
using glht() from the multcomp package. I do this using the way that has
worked for me with lmer() objects in the past: set up a contrast matrix and
then feed it to glht():

designmatrix <- matrix(0, nrow=3, ncol=18)
rownames(designmatrix) <- c("Cond1_minus_Cond2", "Cond3_minus_Cond1",
"Cond3_minus_Cond2")
designmatrix[1, 1:6] <- 1
designmatrix[1, 7:12] <- -1
designmatrix[2, 1:6] <- -1
designmatrix[2, 13:18] <- 1
designmatrix[3, 13:18] <- 1
designmatrix[3, 7:12] <- -1

library(multcomp)

glht( model.Anova, linfct=designmatrix )

However, when I give glht() an Anova object, I get the following error:

> glht( model.anova, linfct=designmatrix )
Error in UseMethod("vcov") :
  no applicable method for 'vcov' applied to an object of class "Anova.mlm"
Error in modelparm.default(model, ...) :
  no ‘vcov’ method for ‘model’ found!

Does anyone know how if it's possible to use glht with an Anova object? (I
guess I can get these same comparisons by re-doing the anova using aov() or
lme(), since I don't need the Huynh-Feldt corrections in the post-hoc
tests...but I am just curious if i can do the post-hocs directly on my
Anova object.)

Best,
Steve Politzer-Ahles

-- 
Stephen Politzer-Ahles
University of Kansas
Linguistics Department
http://people.ku.edu/~sjpa/

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to