Learn R Programming

MplusAutomation (version 0.6-1)

readModels: Read Parameters, Summary Statistics, and Savedata from Mplus Output

Description

Extracts the model parameters, summary statistics, and savedata from the one or more Mplus output files. This function is essentially a wrapper around extractModelParameters, extractModelSummaries, and getSavedata_Data, respectively. The goal is to have a single function that parses all (supported) aspects of Mplus output and to combine these into a list object, with one element per output file identified.

Usage

readModels(target = getwd(), recursive = FALSE,
    filefilter)

Arguments

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/Michae
recursive
optional. If TRUE, parse all models nested in subdirectories within target. Defaults to FALSE.
filefilter
a Perl regular expression (PCRE-compatible) specifying particular output files to be parsed within directory. See regex or http://www.pcre.org/pcre.txt for details about regular expression syntax.

Value

  • A list with one element per file. Each element is composed of up to three subelements: summaries, parameters, and savedata. If target is a single file, then the top-level elements will be the summaries, parameters, and savedata, not a list of files.
  • summariesSummary statistics from extractModelSummaries, having structure as specified by that function
  • parametersModel parameters from extractModelParameters, having structure as specified by that function
  • class_countsLatent class counts and proportions for models that include a categorical latent variable
  • mod_indicesModel modification indices from extractModIndices, having structure as specified by that function
  • savedata_infoFile information about SAVEDATA files related to this output
  • savedataSAVEDATA file as an R data.frame, as described in getSavedata_Data
  • bparametersan mcmc.list object containing the draws from the MCMC chains for a Bayesian model that uses the SAVEDATA: BPARAMETERS command
  • residualsa list containing relevant information from OUTPUT: RESIDUALS
  • tech1a list containing parameter specification and starting values from OUTPUT: TECH1
  • tech3a list containing parameter covariance and correlation matrices from OUTPUT: TECH3
  • tech4a list containing means, covariances, and correlations for latent variables from OUTPUT: TECH4
  • lcCondMeansconditional latent class means, obtained using auxiliary(e) syntax in latent class models
  • gh5a list containing data from the gh5 (graphics) file corresponding to this output. (Requires rhdf5 package)

See Also

extractModelSummaries, extractModelParameters, extractModIndices, getSavedata_Fileinfo, getSavedata_Data, getSavedata_Bparams

Examples

Run this code
allOutput <- readModels(
    "C:/Program Files/Mplus/Mplus Examples/User's Guide Examples", recursive=TRUE)

Run the code above in your browser using DataLab