1\docType{data}
2\name{sleepstudy}
3\alias{sleepstudy}
4\title{Reaction times in a sleep deprivation study}
5\format{A data frame with 180 observations on the following 3 variables.
6  \describe{
7    \item{\code{Reaction}}{Average reaction time (ms)}
8    \item{\code{Days}}{Number of days of sleep deprivation}
9    \item{\code{Subject}}{Subject number on which the observation was made.}
10  }}
11\description{
12  The average reaction time per day (in milliseconds) for subjects in a sleep
13  deprivation study.
14
15  Days 0-1 were adaptation and training (T1/T2), day 2 was baseline (B);
16  sleep deprivation started after day 2.
17
18}
19\details{
20  These data are from the study described in Belenky et al.
21  (2003), for the most sleep-deprived group (3 hours time-in-bed)
22  and for the first 10 days of the study, up to the recovery period.
23  The original study analyzed speed (1/(reaction time)) and treated
24  day as a categorical rather than a continuous predictor.
25}
26\examples{
27str(sleepstudy)
28require(lattice)
29xyplot(Reaction ~ Days | Subject, sleepstudy, type = c("g","p","r"),
30       index = function(x,y) coef(lm(y ~ x))[1],
31       xlab = "Days of sleep deprivation",
32       ylab = "Average reaction time (ms)", aspect = "xy")
33(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, subset=Days>=2))
34## independent model
35(fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy, subset=Days>=2))
36}
37\references{
38  Gregory Belenky, Nancy J. Wesensten, David R. Thorne,
39  Maria L. Thomas, Helen C. Sing, Daniel P. Redmond,
40  Michael B. Russo and Thomas J. Balkin (2003) Patterns of
41  performance degradation and restoration during sleep
42  restriction and subsequent recovery: a sleep
43  dose-response study. \emph{Journal of Sleep Research}
44  \bold{12}, 1--12.
45}
46\keyword{datasets}
47
48