| parse_mplus_polychoric | R Documentation |
Reads a Mplus .out file and assembles the polychoric (tetrachoric)
correlation matrix that Mplus prints under SAMPLE STATISTICS when
SAMPSTAT is requested in the OUTPUT section.
parse_mplus_polychoric(out_file)
out_file |
Character. Full path to a Mplus |
The matrix can be passed directly to besem_ordered via the
r_obs_override argument so that R's DWLS optimisation uses the
same polychoric estimates as Mplus, eliminating rotational discrepancies
caused by differences in the polychoric estimators.
A named, symmetric numeric matrix of polychoric correlations with 1s on the diagonal. Row and column names are the item names as reported by Mplus (typically upper-case).
## Not run:
# Reads a polychoric matrix from a Mplus .out file (SAMPSTAT output),
# so it needs a .out produced by a licensed Mplus run.
R_mplus <- parse_mplus_polychoric(
"path/to/besem_measurement.out"
)
dim(R_mplus) # 18 x 18
# Use as input to besem_ordered so R rotates from the same matrix as Mplus
fit_b <- besem_ordered(
data = mydata,
specific_factors = factor_items,
r_obs_override = R_mplus
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.