R/readModels.R
readModels.Rd
Extracts information from one or more Mplus output files, including fit statistics and parameters. Its is to parse all (supported) aspects of Mplus output and to combine these into a list object, with one element per output file identified.
readModels( target = getwd(), recursive = FALSE, filefilter, what = "all", quiet = TRUE )
target | the directory containing Mplus output files (.out) to parse OR the single output file to be parsed. May be a full path, relative path, or a filename within the working directory. Defaults to the current working directory. Example: "C:/Users/Michael/Mplus Runs" |
---|---|
recursive | optional. If |
filefilter | a Perl regular expression (PCRE-compatible)
specifying particular output files to be parsed within
|
what | a character vector denoting what aspects of Mplus output to extract.
Defaults to |
quiet | whether to suppress printing to the screen the file currently being processed. Defaults to TRUE. |
A list with one mplus.model per file. Each mplus.model object is composed of
elements containing major output sections, as detailed below. If
target
is a single file, then the top-level elements will be
a single mplus.model object, not a list of files. Specific elements are:
Mplus input syntax parsed into a list by major section
Syntax and estimation warnings as a list
Syntax and estimation errors as a list
Output of SUMMARY OF DATA section, including cluster sizes and ICCs
Sample statistics provided by OUTPUT: SAMPSTAT, if specified
Covariance coverage matrix for checking missingness patterns
Summary statistics from extractModelSummaries
, having structure as specified by that function
Model parameters from extractModelParameters
, having structure as specified by that function
Latent class counts and proportions for models that include a categorical latent variable
Output of MODEL INDIRECT if available in output. Contains $overall
and $specific
data.frames for each indirect effect section
Model modification indices from extractModIndices
, having structure as specified by that function
a list containing relevant information from OUTPUT: RESIDUALS
File information about SAVEDATA files related to this output
SAVEDATA file as an R data.frame
, as described in getSavedata_Data
an mcmc.list
object containing the draws from the MCMC chains for a Bayesian model that uses the
SAVEDATA: BPARAMETERS command
a list containing parameter specification and starting values from OUTPUT: TECH1
a list containing parameter covariance and correlation matrices from OUTPUT: TECH3
a list containing means, covariances, and correlations for latent variables from OUTPUT: TECH4
a list containing sample statistics for each latent class from OUTPUT: TECH7
a list containing optimization history of the model. Currently only supports potential scale reduction in BAYES. OUTPUT: TECH8
a list containing warnings/errors from replication runs for MONTECARLO analyses from OUTPUT: TECH9
a list containing model fit information from OUTPUT: TECH10
a list containing observed versus estimated sample statistics for TYPE=MIXTURE analyses from OUTPUT: TECH12
factor score mean, correlation, and covariance structure from SAMPLE STATISTICS FOR ESTIMATED FACTOR SCORES section
conditional latent class means and pairwise comparisons, obtained using auxiliary(e) syntax in latent class models
a list containing data from the gh5 (graphics) file corresponding to this output. (Requires rhdf5 package)
The entire, raw output file.
The what
parameter defaults to "all", which extracts all supported output. If you would like to extract a
reduced set of output sections (especially to speed up the function when reading many files), specify the sections
as a character vector from the following options:
c("input", "warn_err", "data_summary", "sampstat", "covariance_coverage", "summaries", "parameters", "class_counts", "indirect", "mod_indices", "residuals", "savedata", "bparameters", "tech1", "tech3", "tech4", "tech7", "tech8", "tech9", "tech10", "tech12", "fac_score_stats", "lcCondMeans", "gh5", "output")
Michael Hallquist
if (FALSE) { allOutput <- readModels( "C:/Program Files/Mplus/Mplus Examples/User's Guide Examples", recursive=TRUE) }