On 2007-11-22, Dieter Menne <[EMAIL PROTECTED]> wrote: > Tyler Smith <tyler.smith <at> mail.mcgill.ca> writes: > >> I'm trying to figure out how anova works in R by translating the >> examples in Sokal And Rohlf's (1995 3rd edition) Biometry. I've hit a >> snag with planned comparisons, their box 9.4 and section 9.6. It's a >> basic anova design: >> > > .... how to do contrast.... > > It's easier to use function estimable in package gmodels, or glht in package > multcomp. >
Isn't glht calculating unplanned comparisons, as opposed to the planned comparisons with contrasts() and summary(..., split= ...)? Can you do planned comparisons with glht, or unplanned comparisons with summary()? contrasts(warpbreaks$tension) <- matrix(c(-1,1,0,1,0,-1,0,-1,1), 3, 3) amod <- aov(formula = breaks ~ tension, data = warpbreaks) ## this isn't right: summary(amod, split = list(tension = list('L vs M' =1, 'L vs H'=2, 'M vs H' = 3))) ## posthoc contrasts (three ways to do the same test, I think): summary(glht(amod, linfct = mcp(tension = 'Tukey'))) summary(glht(amod, linfct = mcp(tension = matrix(c(-1,1,0,1,0,-1,0,-1,1), 3, 3)))) TukeyHSD(amod) Thanks, Tyler ______________________________________________ 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.