Learn R Programming

SASmixed (version 0.1-7)

HR: Heart rates of patients on different drug treatments

Description

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

Arguments

source

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).

Examples

Run this code
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.5) ) # 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 )

Run the code above in your browser using DataLab