JoinModels {cmm}R Documentation

JoinModels

Description

Returns the simultaneous specification of two models

Usage

JoinModels(...)

Arguments

...

list of ‘compatible’ models, i.e., each model is specified using the same number of functions (and matrices)

Details

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.

Value

CMM model form

Author(s)

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

References

Bergsma, W. P. (1997). Marginal models for categorical data. Tilburg, The Netherlands: Tilburg University Press. 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.

See Also

DirectSum, SpecifyCoefficient, MarginalModelFit

Examples

# 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)
fit=MarginalModelFit(n,model12)

[Package cmm version 1.0 Index]