Ordinal Data Interface

1 reply [Last post]
mspiegel's picture
Offline
Joined: 07/31/2009

At the last developer's meeting, it was decided that the ideas presented in Ordinal Data Proposal #2 would be implemented. The mxFIMLObjective(), mxMLObjective(), and mxRAMObjective() functions have been updated with a new argument "thresholds" (in the subversion trunk). This new argument is a character string that will be the name of the MxMatrix that will serve as the thresholds matrix. The thresholds matrix is an r x c matrix where r equals the length of the data with the most levels minus one and c must equal the dimensions of the covariance matrix. The thresholds matrix must have column dimnames, and each column name must have a column name of the data with identical name (the observed slot in mxData). I believe the column names of the thresholds matrix must be identical to the column names of the covariance matrix (is this true)? The thresholds in the MxMatrix object are defined in increasing order (1, 2, 3, 4, 5, etc.) and not as offsets which is used in original Mx. Unused entries in a particular column must be filled with NAs. The observed slot in the mxData object must be a data.frame and must contain all ordinal data (we will not support ordinal/continuous hybrids at first). If you which to specify factor levels, then use the R functions ordered() or factor(ordered = TRUE) on your data columns. Otherwise we invoke the function as.ordered() on all columns with corresponding entries in the thresholds matrix, which creates factor levels using sort(unique.default(x), na.last = TRUE). Hmm, we might need to change our story for missing data.

What do I need from you? Well the interface for ordinal data is in the repository, but the front-end or back-end currently ignores whatever is provided. But we need test scripts once this functionality is implemented. Preferably test scripts with omxCheckCloseEnough() statements so we can also check for correctness. Don't bother running the models yet, just place the tests into models/failing. Or post to the forums if you don't have subversion write access.

mspiegel's picture
Offline
Joined: 07/31/2009
CORRECTION: The column names

CORRECTION: The column names of the thresholds matrix must be set equal to the column names of the covariance matrix, but the order of the names may be different. At some point we will allow continuous and ordinal data to exist in the same optimization. Once that's available, we'll need to allow the thresholds matrix to allow only a subset of covariance columns.