thresholds matrix helper function
Posted on

Attachment | Size |
---|---|
MxThresholdHelper.R | 2.93 KB |
I started putting together a function that will generate a thresholds matrix. The implementation is attached to this post. The function
omxGenerateThresholds
accepts five arguments:
data
- a data frame that has been transformed with mxFactor()threshNames
- a character vector of the column names. In OpenMx 1.0 must be equal to the column names of the data set.threshLabels
- a character vector of the free parameter names. Used to specify equality constraints.lowVals
- a numeric vector of the low thresholds values.highVals
- a numeric vector of the high threshold values.
So, for example, to generate the thresholds matrix for the test script OrdinalTest.R use the command:
thresh <- omxGenerateThresholds(data, nameList, c("neur", "mdd4l", "neur", "mdd4l"), c(-1.9, 1, -1.9, 1), c(1.9, 1, 1.9, 1))