1
$\begingroup$

If I use lme for mixed ANOVA as follow

lme_model=lme(dv ~ between*within, data frame, random=~1|ID, correlation=corCompSymm(form=~1|ID))

how can I perform between group comparison for every level of within factor?

This great answer advice to use anova with L argument. But I can't understand how.

Thanks for the help

$\endgroup$
  • 1
    $\begingroup$ Did you try the lsmeans and multcomp packages ? $\endgroup$ – Stéphane Laurent Feb 11 '13 at 21:55
  • $\begingroup$ Thank you. Lsmeans is what I am looking for. multcomp with summary(glht(lme_model, linfct=mcp(between = "Tukey")), test = adjusted(type = "fdr")) lead to warning In mcp2matrix(model, linfct = linfct) : covariate interactions found -- default contrast might be inappropriate. Is lsmeans concerned about covariate interactions? $\endgroup$ – sviter Feb 12 '13 at 8:35
  • $\begingroup$ I think there are significant interactions in your fitting and then you get a warning about comparing main effects in such a situation because this comparison is possibly meaningless. $\endgroup$ – Stéphane Laurent Feb 12 '13 at 9:23
  • $\begingroup$ Sorry, but I don't understand your last thought. I decided to use lsmeans(lme_model, pairwise ~ between | within). $\endgroup$ – sviter Feb 12 '13 at 9:36
  • 1
    $\begingroup$ When you have a model with two factors, say A and B, it is not pertinent to assess the effect of these factors when the interaction A:B is significant. I think multcompand/or lsmeans returns a warning in such situations. $\endgroup$ – Stéphane Laurent Feb 12 '13 at 9:40
1
$\begingroup$

If you are looking for post-hoc tests you should find additional functions in R such as TukeyHSD for example.

If you want to perform planned comparisons with your anova, I am used to enter directly contrast codes in the linear model.

I found a simple example here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.