maop package:maop R Documentation _M_i_x_e_d _A_u_t_o_r_e_g_r_e_s_s_i_v_e _O_r_d_e_r_e_d _P_r_o_b_i_t _M_o_d_e_l_s _D_e_s_c_r_i_p_t_i_o_n: Fits mixed autoregressive ordered probit models to a longitudinal data set by maximum pairwise likelihood. _U_s_a_g_e: maop(formula, subjects, periods=subjects, randomEffect=FALSE, dynamics=NULL, startValues=NULL, distance=2, print.info=TRUE) _A_r_g_u_m_e_n_t_s: formula: a formula expression of form 'response ~ predictors'. The response must be an ordinal factor. The model fitted is a dynamic generalization of the ordered probit regression model and it must have an intercept. See the documentation of 'formula' for other details. subjects: identifier for the different subjects in the longitudinal study. This is a vector of the same length of the response containing identifiers for the different subjects. See the example. periods: identifier for the different measurement periods of the subjects in the longitudinal study. The default value is equal to that of 'subjects' assuming one single measurement period for each patient. Otherwise, 'periods' is a vector of the same length of the response containing identifiers for the different measurement periods. See the example. randomEffect: logical. Should a subject-specific random effect be included? dynamics: a factor whose levels correspond to different autocorrelation parameters. The default value is 'NULL' indicating an unique autocorrelation parameter. startValues: starting values. The default value is 'NULL' meaning that starting values are computed automatically by the 'maop' function distance: maximal distance within pairs of observations included in the pseudolikelihood. print.info: logical. Should information about computation status be printed?. _D_e_t_a_i_l_s: MAOP stands for _mixed autoregressive ordered probit_ models, as described in Varin and Czado (2009). Model fitting is performed by maximum pairwise likelihood (Varin, 2008). _V_a_l_u_e: An object of class 'maop'. The components of an object of the class 'maop' are formula: fitted model. subjects: factor denoting different subjects. periods: factor denoting different measurement periods. isRandomEffect: whether a subject-specific random effect is included in the model. dynamics: factor denoting different autocorrelation parameters. distance: maximal admissible distance between pairs of observations. startValues: starting values. coeff: maximum pairwise likelihood estimator. stdErr: estimated standard errors. varMatrix: estimated variance-covariance matrix of the parameter estimates. logPair: maximized log-pairwise likelihood. clic: composite likelihood information criterion (Varin and Vidoni, 2005). convergence: integer code as in 'optim' function. _A_u_t_h_o_r(_s): Cristiano Varin _R_e_f_e_r_e_n_c_e_s: Varin, C. and Vidoni, P. (2005). A note on composite likelihood inference and model selection. _Biometrika_, *92*, 519-528. Varin, C. (2008). On composite marginal likelihoods. _Advances in Statistical Analysis_, *92*, 1-28. Varin, C. and Czado, C. (2009). A mixed autoregressive probit model for ordinal longitudinal data. _Biostatistics_, to appear. _S_e_e _A_l_s_o: 'migraine', 'optim', 'polr' _E_x_a_m_p_l_e_s: # Fits a MAOP model to migraine data (Varin and Czado, 2009) data(migraine) attach(migraine) # covariates university <-rep(0,length(HA)) university[ED==5]<-1 university[ED==6]<-1 university[ED==7]<-1 university <- as.factor(university==1) analgesics <- as.factor(MEDANALG=="Y") # weather covariates wc <- factor(cut(MINWC, breaks=c(-50, -10, 0, 10, 30))) high.pressure <- PMN>10130 high.pressure.yesterday <- PMN1P>10130 change <- rep("persistence", length(high.pressure)) change[(!high.pressure & high.pressure.yesterday)] <- "worse" change[(high.pressure & !high.pressure.yesterday)] <- "better" change <- factor(change) humidity <- cut(RHMN, breaks=c(0, 60, 80, 100)) # model m <- HA~university+analgesics+wc+humidity+change # fit model m with different autocorrelation parameters # for patients with analgesics intake and those who not # try with pairwise likelihood with maximal distance 2 maop2 <- maop(m, subjects=SUBJECT, periods=PERIOD, randomEffect=TRUE, dynamics=analgesics, distance=2) summary(maop2, digits=2) # pairwise likelihood with maximal distance equals to 6 maop6 <- maop(m, subjects=SUBJECT, periods=PERIOD, randomEffect=TRUE, dynamics=analgesics, distance=6, startValues=maop2$coeff) summary(maop6, digits=2)