sleepstudy               package:lme4               R Documentation

_R_e_a_c_t_i_o_n _t_i_m_e_s _i_n _a _s_l_e_e_p _d_e_p_r_i_v_a_t_i_o_n _s_t_u_d_y

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

     The average reaction time per day for subjects in a sleep
     deprivation study.  On day 0 the subjects had their normal amount
     of sleep. Starting that night they were restricted to 3 hours of
     sleep per night.  The observations represent the average reaction
     time on a series of tests given each day to each subject.

_U_s_a_g_e:

     data(sleepstudy)

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

     A data frame with 180 observations on the following 3 variables.

     '_R_e_a_c_t_i_o_n' Average reaction time (ms)

     '_D_a_y_s' Number of days of sleep deprivation

     '_S_u_b_j_e_c_t' Subject number on which the observation was made.

_D_e_t_a_i_l_s:

     These data are from the study described in Belenky et al. (2003),
     for the sleep-deprived group and for the first 10 days of the
     study, up to the recovery period.

_R_e_f_e_r_e_n_c_e_s:

     Gregory Belenky,  Nancy J. Wesensten, David R. Thorne, Maria L.
     Thomas, Helen C. Sing, Daniel P. Redmond, Michael B. Russo and
     Thomas J. Balkin (2003) Patterns of performance degradation and
     restoration during sleep restriction and subsequent recovery: a
     sleep dose-response study. _Journal of Sleep Research_ *12*, 1-12.

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

     str(sleepstudy)
     xyplot(Reaction ~ Days | Subject, sleepstudy, type = c("g","p","r"),
            index = function(x,y) coef(lm(y ~ x))[1],
            xlab = "Days of sleep deprivation",
            ylab = "Average reaction time (ms)", aspect = "xy")
     (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
     (fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy))

