cmcre                package:repeated                R Documentation

_C_o_n_t_i_n_u_o_u_s-_t_i_m_e _T_w_o-_s_t_a_t_e _M_a_r_k_o_v _P_r_o_c_e_s_s_e_s _w_i_t_h _R_a_n_d_o_m _E_f_f_e_c_t

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

     'cmcre' fits a two-state Markov process in continuous time,
     possibly with one or two random effects and/or one covariate.

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

     cmcre(response, covariate=NULL, parameters, pcov=NULL, gradient=FALSE,
             hessian=FALSE, print.level=0, ndigit=10, gradtol=0.00001,
             steptol=0.00001, iterlim=100, fscale=1, typsiz=abs(parameters),
             stepmax=parameters)

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

response: A six-column matrix. Column 1: subject identification
          (subjects can occupy several rows); column 2: time gap
          between events; columns 3-6: transition matrix frequencies.

covariate: An optional vector of length equal to the number of rows of
          'response' upon which the equilibrium probability may depend.

parameters: Initial parameter estimates. The number of them determines
          the model fitted (minimum 2, yielding an ordinary Markov
          process). 1: beta1=log(-log(equilibrium probability)); 2:
          beta2=log(sum of transition intensities); 3:
          log(tau1)=log(random effect variance for equilibrium
          probability); 4: log(tau2)=log(random effect variance for sum
          of transition intensities).

    pcov: Initial parameter estimate for the covariate influencing the
          equilibrium probability: exp(-exp(beta1+beta*covariate)).

gradient: If TRUE, analytic gradient is used (with accompanying loss of
          speed).

 hessian: If TRUE, analytic hessian is used (with accompanying loss of
          speed).

  others: Arguments controlling 'nlm'.

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

     A list of class 'cmcre' is returned.

_A_u_t_h_o_r(_s):

     R.J. Cook and J.K. Lindsey

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

     Cook, R.J. (1999) A mixed model for two-state Markov processes
     under panel observations. Biometrics 55, 915-920.

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

     'chidden', 'hidden'.

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

     # 12 subjects observed at intervals of 7 days
     y <- matrix(c(1,7,1,2,3,5,
             2,7,10,2,2,0,
             3,7,7,0,1,1,
             4,7,2,1,0,7,
             5,7,1,1,1,11,
             6,7,5,4,4,1,
             7,7,1,1,1,8,
             8,7,2,3,4,2,
             9,7,9,0,0,0,
             10,7,0,1,2,8,
             11,7,8,2,2,1,
             12,7,9,2,2,1),ncol=6, byrow=TRUE)
     # ordinary Markov process
     cmcre(y, par=c(-0.2,-1))
     # random effect for the equilibrium probability
     cmcre(y, par=c(-0.1,-2,-0.8))
     # random effects for the equilibrium probability and sum of transition
     #   intensities
     cmcre(y, par=c(-0.1,-1.4,-0.5,-1))

