-
Notifications
You must be signed in to change notification settings - Fork 0
/
HR.Rd
55 lines (55 loc) · 1.7 KB
/
HR.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\name{HR}
\alias{HR}
\non_function{}
\title{Heart rates of patients on different drug treatments}
\description{
The \code{HR} data frame has 120 rows and 5 columns of the heart
rates of patients under one of three possible drug treatments.
}
\format{
This data frame contains the following columns:
\describe{
\item{Patient}{
an ordered factor indicating the patient.
}
\item{Drug}{
the drug treatment - a factor with levels \code{a},
\code{b} and \code{p} where \code{p} represents the placebo.
}
\item{baseHR}{
the patient's base heart rate
}
\item{HR}{
the observed heart rate at different times in the experiment
}
\item{Time}{
the time of the observation
}
}
}
\source{
Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger,
R. D. (1996), \emph{SAS System for Mixed Models}, SAS Institute
(Data Set 3.5).
}
\examples{
options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
if (require("lattice", quietly = TRUE, character = TRUE)) {
xyplot(HR ~ Time | Patient, HR, type = c("g", "p", "r"), aspect = "xy",
index.cond = function(x, y) coef(lm(y ~ x))[1],
ylab = "Heart rate (beats/min)")
}
(fm1HR <- lmer(HR ~ Time * Drug + baseHR + (Time|Patient), HR)) # linear trend in time
anova(fm1HR)
\dontrun{
fm2HR <- update(fm1HR, weights = varPower(0.5)) # use power-of-mean variance
summary(fm2HR)
intervals(fm2HR) # variance function does not seem significant
anova(fm1HR, fm2HR) # confirm with likelihood ratio
}
(fm3HR <- lmer(HR ~ Time + Drug + baseHR + (Time|Patient), HR))
anova(fm3HR)
(fm4HR <- lmer(HR ~ Time + baseHR + (Time|Patient), HR)) # remove Drug term
anova(fm4HR)
}
\keyword{datasets}