cld                 package:multcomp                 R Documentation

_S_e_t _u_p _a _c_o_m_p_a_c_t _l_e_t_t_e_r _d_i_s_p_l_a_y _o_f _a_l_l _p_a_i_r-_w_i_s_e _c_o_m_p_a_r_i_s_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Extract information from 'glht', 'summary.glht' or 'confint.glht'
     objects which is required to create and plot compact letter
     displays of all pair-wise comparisons.

_U_s_a_g_e:

     ## S3 method for class 'summary.glht':
     cld(object, level = 0.05, ...)
     ## S3 method for class 'glht':
     cld(object, level = 0.05, ...)
     ## S3 method for class 'confint.glht':
     cld(object,...)

_A_r_g_u_m_e_n_t_s:

  object: An object of class 'glht', 'summary.glht' or 'confint.glht'. 

   level: Significance-level to be used to term a specific pair-wise
          comparison significant. 

     ...: additional arguments.

_D_e_t_a_i_l_s:

     This function extracts all the information from 'glht',
     'summary.glht' or 'confint.glht' objects that is required to
     create a compact letter display of all pair-wise comparisons. In
     case the contrast matrix is not of type '"Tukey"', an error is
     issued. In case of 'confint.glht' objects, a pair-wise comparison
     is termed significant whenever a particular confidence interval
     contains 0. Otherwise, p-values are compared to the value of
     '"level"'. Once, this information is extracted, plotting of all
     pair-wise comparisons can be carried out.

_V_a_l_u_e:

     An object of class 'cld', a list with items: 

       y: Values of the response variable of the original model. 

   yname: Name of the response variable. 

       x: Values of the variable used to compute Tukey contrasts. 

 weights: Weights used in the fitting process. 

      lp: Predictions from the fitted model. 

   covar: A logical indicating whether the fitted model contained
          covariates. 

  signif: Vector of logicals indicating significant differences with
          hyphenated names that identify pair-wise comparisons. 

_R_e_f_e_r_e_n_c_e_s:

     Hans-Peter Piepho (2004), AAn Algorithm for a Letter-Based
     Representation of All-Pairwise Comparisons, _Journal of
     Computational and Graphical Statistics_, *13*(2), 456-466.

_S_e_e _A_l_s_o:

     'glht' 'plot.cld'

_E_x_a_m_p_l_e_s:

       ### multiple comparison procedures
       ### set up a one-way ANOVA
       data(warpbreaks)
       amod <- aov(breaks ~ tension, data = warpbreaks)
       ### specify all pair-wise comparisons among levels of variable "tension"
       tuk <- glht(amod, linfct = mcp(tension = "Tukey"))
       ### extract information
       tuk.cld <- cld(tuk)
       ### use sufficiently large upper margin
       old.par <- par( mai=c(1,1,1.25,1))
       ### plot
       plot(tuk.cld)
       par(old.par)
       
       ### now using covariates
       data(warpbreaks)
       amod2 <- aov(breaks ~ tension + wool, data = warpbreaks)
       ### specify all pair-wise comparisons among levels of variable "tension"
       tuk2 <- glht(amod2, linfct = mcp(tension = "Tukey"))
       ### extract information
       tuk.cld2 <- cld(tuk2)
       ### use sufficiently large upper margin
       old.par <- par( mai=c(1,1,1.25,1))
       ### plot using different colors
       plot(tuk.cld2, col=c("black", "red", "blue"))
       par(old.par)

       ### set up all pair-wise comparisons for count data
       data(Titanic)
       mod <- glm(Survived ~ Class, data = as.data.frame(Titanic), weights = Freq, family = binomial())
       ### specify all pair-wise comparisons among levels of variable "Class"
       glht.mod <- glht(mod, mcp(Class = "Tukey"))
       ### extract information
       mod.cld <- cld(glht.mod)
       ### use sufficiently large upper margin
       old.par <- par(mai=c(1,1,1.5,1))
       ### plott
       plot(mod.cld)
       par(old.par)

