gwsem (version 0.1.5)

setupThresholds: Set up thresholds for ordinal indicators

Description

Ordinal indicator thresholds are freely estimated with fixed means and variance. This function adds thresholds to the given model. If no indicators are ordinal, the given model is returned without changes.

Usage

setupThresholds(model)

Arguments

model

an instance of MxModel

Value

The given MxModel with appropriate thresholds added.

Details

Thresholds are added using mxThreshold. Starting values for thresholds use the defaults provided by this function which assumes a mean of zero and variance of the square root of two. This variance is appropriate for buildOneFac where the implied model variance of ordinal indicators is one plus the square of the factor loading, and the loading's starting value is 1.0.

You generally do not need to call this function directly because it is already called by buildOneFac and similar. This function is provided for advanced users who wish to write their own model building functions.

Examples

Run this code
# NOT RUN {
pheno <- data.frame(anxiety=cut(rnorm(500), c(-Inf, -.5, .5, Inf),
                    ordered_result = TRUE))
m1 <- buildOneItem(pheno, 'anxiety')
m1 <- setupThresholds(m1)
m1$Thresholds
# }

Run the code above in your browser using DataLab