waste                package:multcomp                R Documentation

_I_n_d_u_s_t_r_i_a_l _W_a_s_t_e _D_a_t_a _S_e_t

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

     Industrial waste output in a manufactoring plant.

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

     data("waste")

_F_o_r_m_a_t:

     This data frame contains the following variables

     _t_e_m_p temperature, a factor at three levels: 'low', 'medium',
          'high'.

     _e_n_v_i_r environment, a factor at five levels: 'env1' ... 'env5'.

     _w_a_s_t_e response variable: waste output in a manufacturing plant.

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

     The data are from an experiment designed to study the effect of
     temperature ('temp') and environment ('envir') on waste output in
     a manufactoring plant. Two replicate measurements were taken at
     each temperature / environment combination.

_S_o_u_r_c_e:

     P. H. Westfall, R. D. Tobias, D. Rom, R. D. Wolfinger, Y. Hochberg
     (1999). _Multiple Comparisons and Multiple Tests Using the SAS
     System_. Cary, NC: SAS Institute Inc., page 177.

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

       ### set up two-way ANOVA with interactions
       amod <- aov(waste ~ temp * envir, data=waste)

       ### comparisons of main effects only
       K <- glht(amod, linfct = mcp(temp = "Tukey"))$linfct
       K
       glht(amod, K)

       ### comparisons of means (by averaging interaction effects)
       low <- grep("low:envi", colnames(K))
       med <- grep("medium:envi", colnames(K))
       K[1, low] <- 1 / (length(low) + 1)
       K[2, med] <- 1 / (length(low) + 1)
       K[3, med] <- 1 / (length(low) + 1)
       K[3, low] <- - 1 / (length(low) + 1)
       K
       confint(glht(amod, K))

       ### same as TukeyHSD
       TukeyHSD(amod, "temp")

       ### set up linear hypotheses for all-pairs of both factors
       wht <- glht(amod, linfct = mcp(temp = "Tukey", envir = "Tukey"))

       ### cf. Westfall et al. (1999, page 181)
       summary(wht, test = adjusted("Shaffer"))

