epil                  package:MASS                  R Documentation

_S_e_i_z_u_r_e _C_o_u_n_t_s _f_o_r _E_p_i_l_e_p_t_i_c_s

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

     Thall and Vail (1990) give a data set on two-week seizure counts
     for 59 epileptics.  The number of seizures was recorded for a
     baseline period of 8 weeks, and then patients were randomly
     assigned to a treatment group or a control group.  Counts were
     then recorded for four successive two-week periods. The subject's
     age is the only covariate.

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

     epil

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

     This data frame has 236 rows and the following 9 columns:

     '_y' The count for the 2-week period.

     '_t_r_t' The treatment, '"placebo"' or '"progabide"'.

     '_b_a_s_e' The counts in the baseline 8-week period.

     '_a_g_e' The subject's age, in years.

     '_V_4' '0/1' indicator variable of period 4.

     '_s_u_b_j_e_c_t' The subject number, 1 to 59.

     '_p_e_r_i_o_d' The period, 1 to 4.

     '_l_b_a_s_e' The log-counts for the baseline period, centred to have
          zero mean.

     '_l_a_g_e' The log-ages, centred to have zero mean.

_S_o_u_r_c_e:

     Thall, P. F. and Vail, S. C. (1990) Some covariance models for
     longitudinal count data with over-dispersion. _Biometrics_ *46*,
     657-671.

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

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth Edition. Springer.

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

     summary(glm(y ~ lbase*trt + lage + V4, family = poisson,
                 data = epil), cor = FALSE)
     epil2 <- epil[epil$period == 1, ]
     epil2["period"] <- rep(0, 59); epil2["y"] <- epil2["base"]
     epil["time"] <- 1; epil2["time"] <- 4
     epil2 <- rbind(epil, epil2)
     epil2$pred <- unclass(epil2$trt) * (epil2$period > 0)
     epil2$subject <- factor(epil2$subject)
     epil3 <- aggregate(epil2, list(epil2$subject, epil2$period > 0),
        function(x) if(is.numeric(x)) sum(x) else x[1])
     epil3$pred <- factor(epil3$pred,
        labels = c("base", "placebo", "drug"))

     contrasts(epil3$pred) <- structure(contr.sdif(3),
         dimnames = list(NULL, c("placebo-base", "drug-placebo")))
     summary(glm(y ~ pred + factor(subject) + offset(log(time)),
                 family = poisson, data = epil3), cor = FALSE)

     summary(glmmPQL(y ~ lbase*trt + lage + V4,
                     random = ~ 1 | subject,
                     family = poisson, data = epil))
     summary(glmmPQL(y ~ pred, random = ~1 | subject,
                     family = poisson, data = epil3))

