HR                 package:SASmixed                 R Documentation

_H_e_a_r_t _r_a_t_e_s _o_f _p_a_t_i_e_n_t_s _o_n _d_i_f_f_e_r_e_n_t _d_r_u_g _t_r_e_a_t_m_e_n_t_s

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

     The `HR' data frame has 120 rows and 5 columns of the heart rates
     of patients under one of three possible drug treatments.

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

     This data frame contains the following columns:

     _P_a_t_i_e_n_t an ordered factor indicating the patient.

     _D_r_u_g the drug treatment - a factor with levels `a', `b' and `p'
            where `p' represents the placebo.

     _b_a_s_e_H_R the patient's base heart rate

     _H_R the observed heart rate at different times in the experiment

     _T_i_m_e the time of the observation

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

     Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, R.
     D. (1996), SAS System for Mixed Models, SAS Institute (Data Set
     3.5).

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

     library(SASmixed)
     options(
       contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
     data(HR)
     coplot(HR ~ Time | Patient, type = "b", data = HR, show = FALSE)
     formula(HR)
     fm1HR <- lme( HR ~ Time * Drug + baseHR, data = HR,  # linear trend in time
        random = ~ Time | Patient)
     summary( fm1HR )
     VarCorr( fm1HR )
     anova( fm1HR )
     fm2HR <- update( fm1HR, weights = varPower(0) ) # use power-of-mean variance
     summary( fm2HR )
     VarCorr( fm1HR )
     intervals( fm2HR )             # variance function does not seem significant
     anova( fm1HR, fm2HR )         # confirm with likelihood ratio
     fm3HR <- update( fm1HR, HR ~ Time + Drug + baseHR ) # remove interaction
     anova( fm3HR )
     summary( fm3HR )
     VarCorr( fm3HR )
     fm4HR <- update( fm3HR, HR ~ Time + baseHR )  # remove Drug term
     anova( fm4HR )
     summary( fm4HR )
     VarCorr( fm4HR )

