emxResiduals: Create a residual variances matrix

View source: R/emxMatrixBuilders.R

emxResidualsR Documentation

Create a residual variances matrix

Description

This function creates a factor loadings matrix as an MxMatrix or MxPath object.

Usage

emxResiduals(x, values=.2, free=TRUE, lbound=NA, ubound=NA, path=FALSE, type='unique')

Arguments

x

character vector. The names of the variables for which residual variances are created.

values

numeric vector. The starting values for the variances.

free

logical vector. Whether the variances are free.

lbound

numeric vector. Lower bounds for the variances.

ubound

numeric vector. Upper bounds for the variances.

path

logical. Whether to return the MxPath object instead of the MxMatrix.

type

character. The kind of residual variance structure to create. See Details.

Details

Possible values for the type argument are 'unique' and 'identical'. When type='unique', each residual variances is a unique free parameter. When type='identical', all of the residual variances are given by a single free parameter. In this case, all the residual variances are constrained to be equal. However, no linear or non-liniear contraint function is used. Rather, a single parameter occurs in multiple locations by using the same label.

Value

Depending on the value of the path argument, either an MxMatrix or and MxPath object that can be inspected, modified, and/or included in MxModel objects.

See Also

emxFactorModel, emxGrowthModel

Examples

   
# Create a residual variance matrix
require(EasyMx)
manVars <- paste0('x', 1:6)
emxResiduals(manVars, lbound=1e-6)
emxResiduals(manVars, type='identical')
emxResiduals(manVars, path=TRUE)


EasyMx documentation built on Feb. 16, 2023, 7:27 p.m.