emxMixtureModel: Create a mixture model

Description Usage Arguments Details Value See Also Examples

View source: R/emxMixture.R

Description

This function creates a mxiture model as an MxModel object.

Usage

1
2
emxMixtureModel(model, data, run=FALSE, p=NA, ...)
emxModelMixture(model, data, run=FALSE, p=NA, ...)

Arguments

model

list. The MxModel objects that compose the mixture.

data

data used for the model

run

logical. Whether to run the model before returning.

p

character. Optional name of the mixing proportions matrix.

...

Further Mx Objects passed into the mixture model.

Details

The model argument is list of MxModel objects. These are the classes over which the mixture model operates.

The p argument is optional. If not specified, the function will create and properly scale the mixing proportions for you. If specified, the Mx Object that gives the mixing proportions should be a column vector (one-column matrix).

Value

An MxModel.

See Also

emxLoadings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
   
# Example
require(EasyMx)
data(myFADataRaw)
xmap1 <- list(F1=paste0('x', 1:6), F2=paste0('y', 1:3), F3=paste0('z', 1:3))
mod1 <- emxFactorModel(xmap1, data=myFADataRaw, name='m1')

xmap2 <- list(F1=c(paste0('x', 1:6), paste0('y', 1:3), paste0('z', 1:3)))
mod2 <- emxFactorModel(xmap2, data=myFADataRaw, name='m2')

mod <- emxMixtureModel(list(mod1, mod2), data=myFADataRaw)
# To estimate parameters either
#  1. mod <- mxRun(mod)   or
#  2. include run=TRUE in the arguments above
summary(mod)
coef(mod)

jpritikin/emx documentation built on May 19, 2019, 11:50 p.m.