Rev 25676 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{TukeyHSD}\alias{TukeyHSD}\alias{TukeyHSD.aov}\alias{print.TukeyHSD}\alias{plot.TukeyHSD}\title{Compute Tukey Honest Significant Differences}\description{Create a set of confidence intervals on the differences between themeans of the levels of a factor with the specified family-wiseprobability of coverage. The intervals are based on the Studentizedrange statistic, Tukey's \sQuote{Honest Significant Difference}method. There is a \code{plot} method.}\usage{TukeyHSD(x, which, ordered = FALSE, conf.level = 0.95, \dots)}\arguments{\item{x}{A fitted model object, usually an \code{\link{aov}} fit.}\item{which}{A list of terms in the fitted model for which theintervals should be calculated. Defaults to all the terms.}\item{ordered}{A logical value indicating if the levels of the factorshould be ordered according to increasing average in the samplebefore taking differences. If \code{ordered} is true thenthe calculated differences in the means will all be positive. Thesignificant differences will be those for which the \code{lwr} endpoint is positive.}\item{conf.level}{A numeric value between zero and one giving thefamily-wise confidence level to use.}\item{\dots}{Optional additional arguments. None are used at present.}}\details{When comparing the means for the levels of a factor in an analysis ofvariance, a simple comparison using t-tests will inflate theprobability of declaring a significant difference when it is not infact present. This because the intervals are calculated with agiven coverage probability for each interval but the interpretation ofthe coverage is usually with respect to the entire family ofintervals.John Tukey introduced intervals based on the range of thesample means rather than the individual differences. The intervalsreturned by this function are based on this Studentized rangestatistics.Technically the intervals constructed in this way would only apply tobalanced designs where there are the same number of observations madeat each level of the factor. This function incorporates an adjustmentfor sample size that produces sensible intervals for mildly unbalanceddesigns.}\value{A list with one component for each term requested in \code{which}.Each component is a matrix with columns \code{diff} giving thedifference in the observed means, \code{lwr} giving the lowerend point of the interval, and \code{upr} giving the upper end point.}\references{Miller, R. G. (1981)\emph{Simultaneous Statistical Inference}. Springer.Yandell, B. S. (1997)\emph{Practical Data Analysis for Designed Experiments}.Chapman \& Hall.}\author{Douglas Bates}\seealso{\code{\link{aov}}, \code{\link{qtukey}}, \code{\link{model.tables}}}\examples{data(warpbreaks)summary(fm1 <- aov(breaks ~ wool + tension, data = warpbreaks))TukeyHSD(fm1, "tension", ordered = TRUE)plot(TukeyHSD(fm1, "tension"))}\keyword{models}\keyword{design}