respiratory             package:multcomp             R Documentation

_R_e_s_p_i_r_a_t_o_r_y _H_e_a_l_t_h _D_a_t_a _S_e_t

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

     Sub-group and whole-group analysis of a respiratory therapy drug;
     data set taken from Westfall et al. (1999, p. 195). Three-way
     ANOVA with weighted contrasts.

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

     data(respiratory)

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

     This data frame contains the following variables

     _T_r_e_a_t_m_e_n_t Treatment at 2 levels: 'Active' and 'Placebo'.

     _A_g_e_G_r_o_u_p Age group at 2 levels: 'Younger' and 'Older'.

     _I_n_i_t_H_e_a_l_t_h Inititial health condition at 2 levels: 'Good' and
          'Poor'.

     _S_c_o_r_e Response variable: time-weighted score comprised  of four
          post-treatment evaluations.

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

     See Westfall et al. (1999, p. 195)

_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.

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

     data(respiratory)

     # compute the contrast matrix in several steps 
     # overall active vs. placebo
     CA  <- c(0, 13, 0, 11, 0, 13, 0, 17, 0)
     CP  <- c(0, 0, 14, 0, 12,  0, 19, 0, 12)
     CA  <- CA/sum(CA)
     CP  <- CP/sum(CP)
     C1  <- CP-CA

     # for older subgroup only
     CAO <- c( 0, 13,  0,  0,  0, 13,  0,  0,  0 ) 
     CPO <- c( 0,  0, 14,  0,  0,  0, 19,  0,  0 ) 
     CAO <- CAO/sum(CAO)
     CPO <- CPO/sum(CPO)
     C2  <- CPO - CAO

     # for younger subgroup only 
     CAY <- c( 0,  0,  0, 11,  0,  0,  0, 17,  0 ) 
     CPY <- c( 0,  0,  0,  0, 12,  0,  0,  0, 12 ) 
     CAY <- CAY/sum(CAY)
     CPY <- CPY/sum(CPY)
     C3  <- CPY - CAY

     # subgroup with inital good health
     CAG <- c( 0, 13,  0, 11,  0,  0,  0,  0,  0 ) 
     CPG <- c( 0,  0, 14,  0, 12,  0,  0,  0,  0 ) 
     CAG <- CAG/sum(CAG)
     CPG <- CPG/sum(CPG)
     C4  <- CPG - CAG

     # subgroup with inital poor health
     CAP <- c( 0,  0,  0,  0,  0, 13,  0, 17,  0 ) 
     CPP <- c( 0,  0,  0,  0,  0,  0, 19,  0, 12 ) 
     CAP <- CAP/sum(CAP)
     CPP <- CPP/sum(CPP)
     C5  <- CPP - CAP

     # all 4 subgroup combinations of age and initial health condition 
     C6  <- c( 0, -1,  1,  0,  0,  0,  0,  0,  0 )
     C7  <- c( 0,  0,  0,  0,  0, -1,  1,  0,  0 )
     C8  <- c( 0,  0,  0, -1,  1,  0,  0,  0,  0 )
     C9  <- c( 0,  0,  0,  0,  0,  0,  0, -1,  1 )

     # contrast matrix, note: first column is zero and corresponds to the
     # intercept implicitly given in the formula
     C   <- rbind(C1, C2, C3, C4, C5, C6, C7, C8, C9)   

     # numerate the contrasts
     colnames(C) <- NULL
     rownames(C) <- c("Overall", "Older", "Younger", "Good Init", "Poor Init",
                      "Old x Good", "Old x Poor", "Young x Good", "Young x Poor") 

     # remove the intercept (not needed, simtest can deal with contrast matrices
     # with and without a column of zeros for the intercept
     C <- C[,-1]

     summary(simtest(Score ~ Treatment:AgeGroup:InitHealth,
                     data=respiratory, ttype="logical",
                     alternative="greater", cmatrix=C))

