HR {SASmixed} | R Documentation |
The HR
data frame has 120 rows and 5 columns of the heart
rates of patients under one of three possible drug treatments.
This data frame contains the following columns:
a
,
b
and p
where p
represents the placebo.
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).
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 )