TukeyHSD                package:stats                R Documentation

_C_o_m_p_u_t_e _T_u_k_e_y _H_o_n_e_s_t _S_i_g_n_i_f_i_c_a_n_t _D_i_f_f_e_r_e_n_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Create a set of confidence intervals on the differences between
     the means of the levels of a factor with the specified family-wise
     probability of coverage.  The intervals are based on the
     Studentized range statistic, Tukey's 'Honest Significant
     Difference' method.  There is a 'plot' method.

_U_s_a_g_e:

     TukeyHSD(x, which, ordered = FALSE, conf.level = 0.95, ...)

_A_r_g_u_m_e_n_t_s:

       x: A fitted model object, usually an 'aov' fit.

   which: A list of terms in the fitted model for which the intervals
          should be calculated.  Defaults to all the terms.

 ordered: A logical value indicating if the levels of the factor should
          be ordered according to increasing average in the sample
          before taking differences.  If 'ordered' is true then the
          calculated differences in the means will all be positive. 
          The significant differences will be those for which the 'lwr'
          end point is positive.

conf.level: A numeric value between zero and one giving the family-wise
          confidence level to use.

     ...: Optional additional arguments.  None are used at present.

_D_e_t_a_i_l_s:

     When comparing the means for the levels of a factor in an analysis
     of variance, a simple comparison using t-tests will inflate the
     probability of declaring a significant difference when it is not
     in fact present.  This because the intervals are calculated with a
     given coverage probability for each interval but the
     interpretation of the coverage is usually with respect to the
     entire family of intervals.

     John Tukey introduced intervals based on the range of the sample
     means rather than the individual differences.  The intervals
     returned by this function are based on this Studentized range
     statistics.

     Technically the intervals constructed in this way would only apply
     to balanced designs where there are the same number of
     observations made at each level of the factor.  This function
     incorporates an adjustment for sample size that produces sensible
     intervals for mildly unbalanced designs.

     If 'which' specifies non-factor terms these will be dropped with a
     warning: if no terms are left this is a an error.

_V_a_l_u_e:

     A list with one component for each term requested in 'which'. Each
     component is a matrix with columns 'diff' giving the difference in
     the observed means, 'lwr' giving the lower end point of the
     interval, and 'upr' giving the upper end point.

_A_u_t_h_o_r(_s):

     Douglas Bates

_R_e_f_e_r_e_n_c_e_s:

     Miller, R. G. (1981) _Simultaneous Statistical Inference_.
     Springer.

     Yandell, B. S. (1997) _Practical Data Analysis for Designed
     Experiments_. Chapman & Hall.

_S_e_e _A_l_s_o:

     'aov', 'qtukey', 'model.tables'

_E_x_a_m_p_l_e_s:

     summary(fm1 <- aov(breaks ~ wool + tension, data = warpbreaks))
     TukeyHSD(fm1, "tension", ordered = TRUE)
     plot(TukeyHSD(fm1, "tension"))

