depratio                 package:drm                 R Documentation

_E_m_p_i_r_i_c_a_l _e_s_t_i_m_a_t_e_s _o_f _t_h_e _d_e_p_e_n_d_e_n_c_e _r_a_t_i_o_s

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

     Calculates the observed values of the adjacent dependence ratios
     from the data.

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

     depratio(formula, data, subset, ord = 2, boot.ci = FALSE, n.boot = NULL,
              ci.width=0.95) 

_A_r_g_u_m_e_n_t_s:

 formula: the syntax is of form 'y~cluster(id)+Time(time)', where 'id'
          denotes the cluster indicator, and 'Time' denotes the order
          along which the adjacent dependence ratios will be
          calculated.

    data: optional data frame containing the variables in the formula

  subset: an optional vector specifying a subset of observations from
          the data

     ord: order of the dependence ratios to be calculated. The default
          is 2

 boot.ci: logical argument specifying whether bootstrap confidence
          intervals will be calculated for the empirical dependence
          ratio estimates

  n.boot: number of bootstrap replicates

ci.width: width of the confidence interval. Default is 0.95

_V_a_l_u_e:

     An object of class 'depratio'. Generic functions 'print' and
     'plot' are also available.

     An object of class 'depratio' is a list containing at least the
     following two components: 

     tau: matrix of the observed dependence ratios

    freq: matrix of the frequencies of events for the numerator of the
          observed dependence ratios

_S_e_e _A_l_s_o:

     'drm', 'cluster', 'Time'

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

     ## calculate and plot the observed 2nd order dependence ratios
     ## for the marijuana data:
     data(marijuana)
     dr.male <- depratio(y~cluster(id)+Time(age), data=marijuana,
                         subset=sex=="male")
     dr.male
     plot(dr.male)

     ## confirm that the 1st order Markov assumption is adequate
     ## for the madras data:
     data(madras)

     dr2 <- depratio(symptom~cluster(id)+Time(month), data=madras)
     dr3 <- depratio(symptom~cluster(id)+Time(month), ord=3, data=madras)
     dr <- rbind(dr2$tau[-length(dr2$tau)]*dr2$tau[-1], dr3$tau)

     matplot(1:ncol(dr), t(dr))

