Parses Mplus input file and suggests equivalent surveymixr code.
Details
This function reads an Mplus input file for growth mixture models and generates equivalent surveymixr code. Note that not all Mplus features can be directly translated.
Supported Mplus features:
VARIABLE section: NAMES, USEVAR, CLASSES, CLUSTER, WEIGHT, STRATIFICATION
ANALYSIS section: TYPE = MIXTURE, STARTS
MODEL section: Linear and quadratic growth specifications
Examples
if (FALSE) { # \dontrun{
# Create example Mplus file
mplus_code <- '
VARIABLE:
NAMES = id time y stratum psu weight;
USEVAR = y;
CLASSES = c(3);
CLUSTER = psu;
STRATIFICATION = stratum;
WEIGHT = weight;
ANALYSIS:
TYPE = MIXTURE;
STARTS = 500 100;
MODEL:
%OVERALL%
i s | y@0 y@1 y@2 y@3 y@4;
'
writeLines(mplus_code, "example.inp")
r_code <- mplus_to_surveymixr("example.inp")
cat(r_code)
} # }