JoinModels                package:cmm                R Documentation

_J_o_i_n_M_o_d_e_l_s

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

     Returns the simultaneous specification of two models

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

     JoinModels(model1,model2)

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

model1,model2: two models specified in the same way

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

     Models can be of any form allowed in CMM (see 'MarginalModelFit'),
     eg, 'list(bt,coeff,at)', with the restriction that the number of
     columns of the 'at' matrices must be equal, and the list of
     functions in 'coeff' must be identical.

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

     CMM model form

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

     W. P. Bergsma w.p.bergsma@lse.ac.uk

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

     Bergsma, W. P. (1997). _Marginal models for categorical data_.
     Tilburg, The Netherlands: Tilburg University Press. <URL:
     http://stats.lse.ac.uk/bergsma/pdf/bergsma_phdthesis.pdf>

     Bergsma, W. P., Croon, M. A., & Hagenaars, J. A. P. (2009).
     Marginal models for dependent, clustered, and longitudunal
     categorical data. Berlin: Springer.

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

     'DirectSum', 'SpecifyCoefficient', 'MarginalModelFit'

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

     # simultaneously specify marginal independence in two marginal tables

     bt1 = ConstraintMatrix(c("A","B"),list(c("A"),c("B")),c(3,3))
     at1 = MarginalMatrix(c("A","B","C"),c("A","B"),c(3,3,3))
     model1 = list(bt1,"log",at1)

     bt2 = ConstraintMatrix(c("B","C"),list(c("B"),c("C")),c(3,3))
     at2 = MarginalMatrix(c("A","B","C"),c("B","C"),c(3,3,3))
     model2 = list(bt2,"log",at2)

     model12 = JoinModels(model1,model2)

     # the model can be fitted to an artificial data set
     n = c(1:27)
     MarginalModelFit(n,model12)

