diff --git a/R/MplusAutomation.R b/R/MplusAutomation.R index c14c97f..df53d80 100644 --- a/R/MplusAutomation.R +++ b/R/MplusAutomation.R @@ -10,12 +10,10 @@ #' and tabulating model parameters and fit statistics. #' #' @details The MplusAutomation package has four primary purposes: -#' \enumerate{ -#' \item To automatically run groups/batches of models. -#' \item To provide routines to extract model fit statistics, parameter estimates, and raw data from 'Mplus' output files. -#' \item To facilitate comparisons among models -#' \item To provide a template language that allows for the creation of related input files. -#' } +#' * To automatically run groups/batches of models. +#' * To provide routines to extract model fit statistics, parameter estimates, and raw data from 'Mplus' output files. +#' * To facilitate comparisons among models +#' * To provide a template language that allows for the creation of related input files. #' The core routine for running batches of models is \code{\link{runModels}}, with #' an easy-to-use GUI wrapper, \code{\link{runModels_Interactive}}. #' diff --git a/R/compareModels.R b/R/compareModels.R index b1bab50..d1ec180 100644 --- a/R/compareModels.R +++ b/R/compareModels.R @@ -8,42 +8,37 @@ #' #' Model outputs to be compared should come from the \code{readModels} command. #' -#' The \code{show} parameter can be one or more of the following, which can be passed as a vector, such as c("equal", "pdiff"). +#' The \code{show} parameter can be one or more of the following, which can be +#' passed as a vector, such as c("equal", "pdiff"). #' -#' \describe{ -#' \item{show}{ -#' \describe{ -#' \item{"all"}{Display all available model comparison. Equivalent to -#' c("summaries", "equal", "diff", "pdiff", "unique").} -#' \item{"summaries"}{Print a comparison of model summary statistics. Compares the following summary -#' statistics (where available): c("Title", "Observations", "Estimator", "Parameters", "LL", -#' "AIC", "BIC", "ChiSqM_Value", "ChiSqM_DF", "CFI", "TLI", "RMSEA", "SRMR", "WRMR")} -#' \item{"allsummaries"}{Prints a comparison of all summary statistics available in each model. May -#' generate a lot of output.} -#' \item{"equal"}{Print parameter estimates that are equal between models -#' (i.e., \code{<= equalityMargin["param"]})}. -#' \item{"diff"}{Print parameter estimates that are different between models -#' (i.e., \code{> equalityMargin["param"]})}. -#' \item{"pdiff"}{Print parameter estimates where the p-values differ between models -#' (i.e., \code{> equalityMargin["pvalue"]})}. -#' \item{"unique"}{Print parameter estimates that are unique to each model.} -#' } -#' } -#' } +#' * `"all"`: Display all available model comparison. Equivalent to +#' `c("summaries", "equal", "diff", "pdiff", "unique")`. +#' * `"summaries"`: Print a comparison of model summary statistics. Compares +#' the following summary statistics (where available): +#' `c("Title", "Observations", "Estimator", "Parameters", "LL", "AIC", +#' "BIC", "ChiSqM_Value", "ChiSqM_DF", "CFI", "TLI", "RMSEA", "SRMR", +#' "WRMR")`. +#' * `"allsummaries"`: Print a comparison of all summary statistics available +#' in each model. May generate a lot of output. +#' * `"equal"`: Print parameter estimates that are equal between models +#' (i.e., `<= equalityMargin["param"]`). +#' * `"diff"`: Print parameter estimates that are different between models +#' (i.e., `> equalityMargin["param"]`). +#' * `"pdiff"`: Print parameter estimates where the p-values differ between +#' models (i.e., `> equalityMargin["pvalue"]`). +#' * `"unique"`: Print parameter estimates that are unique to each model. #' -#' The \code{sort} parameter determines the order in which parameter estimates are displayed. The following options are available: +#' The \code{sort} parameter determines the order in which parameter estimates +#' are displayed. The following options are available: #' -#' \describe{ -#' \item{sort}{ -#' \describe{ -#' \item{"none"}{No sorting is performed, so parameters are output in the order presented in Mplus. (Default)} -#' \item{"type"}{Sort parameters by their role in the model. This groups output by regression coefficient (ON), -#' factor loadings (BY), covariances (WITH), and so on. Within each type, output is alphabetical.} -#' \item{"alphabetical"}{Sort parameters in alphabetical order.} -#' \item{"maxDiff"}{Sort parameter output by the largest differences between models (high to low).} -#' } -#' } -#' } +#' * `"none"`: No sorting is performed, so parameters are output in the order +#' presented in Mplus. (Default) +#' * `"type"`: Sort parameters by their role in the model. This groups output +#' by regression coefficient (ON), factor loadings (BY), covariances (WITH), +#' and so on. Within each type, output is alphabetical. +#' * `"alphabetical"`: Sort parameters in alphabetical order. +#' * `"maxDiff"`: Sort parameter output by the largest differences between +#' models (high to low). #' #' @param m1 The first Mplus model to be compared. Generated by \code{readModels}. #' @param m2 The second Mplus model to be compared. diff --git a/R/createModels.R b/R/createModels.R index c10789c..f69b95d 100644 --- a/R/createModels.R +++ b/R/createModels.R @@ -147,11 +147,9 @@ getInitTags <- function(initCollection) { #' @param initCollection The initial collection #' @return A list with three elements, where each list represents the location, #' start character, end character, tag type, etc. of each tag. -#' \describe{ -#' \item{initTags}{initMatches} -#' \item{bodyTags}{bodyMatches} -#' \item{bodyText}{bodySection} -#' } +#' * `initTags`: initMatches +#' * `bodyTags`: bodyMatches +#' * `bodyText`: bodySection #' @keywords internal parseTags <- function(bodySection, initCollection) { #first handle init tags diff --git a/R/data.R b/R/data.R index 42f0394..9bb2f44 100644 --- a/R/data.R +++ b/R/data.R @@ -1,22 +1,20 @@ -#' Latent Class Analysis Demonstration -#' -#' A list containing the Mplus Data, Output Files, and GH5 Files for a -#' demonstration of using MplusAutomation for latent class analysis. -#' Generated by the vignette on latent class analysis. -#' -#' @format A list containing 11 elements. -#' \describe{ -#' \item{Data}{2 Class LCA data simulated using Mplus} -#' \item{CFA}{Mplus output file for CFA} -#' \item{LCA2}{Mplus output file for 2 class LCA} -#' \item{LCA3}{Mplus output file for 3 class LCA} -#' \item{LCA4}{Mplus output file for 4 class LCA} -#' \item{LCA5}{Mplus output file for 5 class LCA} -#' \item{CFAGH5}{GH5 file for CFA} -#' \item{LCA2GH5}{GH5 file for 2 class LCA} -#' \item{LCA3GH5}{GH5 file for 3 class LCA} -#' \item{LCA4GH5}{GH5 file for 4 class LCA} -#' \item{LCA5GH5}{GH5 file for 5 class LCA} -#' } -"lcademo" - +#' Latent Class Analysis Demonstration +#' +#' A list containing the Mplus Data, Output Files, and GH5 Files for a +#' demonstration of using MplusAutomation for latent class analysis. +#' Generated by the vignette on latent class analysis. +#' +#' @format A list containing 11 elements. +#' * `Data`: 2 Class LCA data simulated using Mplus +#' * `CFA`: Mplus output file for CFA +#' * `LCA2`: Mplus output file for 2 class LCA +#' * `LCA3`: Mplus output file for 3 class LCA +#' * `LCA4`: Mplus output file for 4 class LCA +#' * `LCA5`: Mplus output file for 5 class LCA +#' * `CFAGH5`: GH5 file for CFA +#' * `LCA2GH5`: GH5 file for 2 class LCA +#' * `LCA3GH5`: GH5 file for 3 class LCA +#' * `LCA4GH5`: GH5 file for 4 class LCA +#' * `LCA5GH5`: GH5 file for 5 class LCA +"lcademo" + diff --git a/R/extractModIndices.R b/R/extractModIndices.R index ece16cb..f28875b 100644 --- a/R/extractModIndices.R +++ b/R/extractModIndices.R @@ -150,15 +150,14 @@ extractModIndices_1file <- function(outfiletext, filename) { #' for a single file, and the top-level elements are named after the #' corresponding output file name. The basic \code{data.frame} containing #' the MODEL MODIFICATION INDICES section of \code{outfile}. Variables include -#' \item{modV1}{The first variable in the pair to be freed according to the M.I.} -#' \item{operator}{The suggested relationship between \code{modV1} and \code{modV2} +#' * `modV1`: The first variable in the pair to be freed according to the M.I. +#' * `operator`: The suggested relationship between \code{modV1} and \code{modV2 #' (e.g., WITH for freeing the covariance between \code{modV1} and \code{modV2})} -#' \item{modV2}{The first variable in the pair to be freed according to the M.I.} -#' \item{MI}{The decrease in model chi-square if the specified relationship is freely estimated} -#' \item{EPC}{The expected parameter estimate between \code{modV1} and \code{modV2} if freed.} -#' \item{Std_EPC}{The EPC value standardized using the variances of the continuous latent variables.} -#' \item{StdYX_EPC}{The EPC value standardized using the variances of the continuous latent -#' variables as well as the variances of the background and/or outcome variables.} +#' * `modV2`: The first variable in the pair to be freed according to the M.I. +#' * `MI`: The decrease in model chi-square if the specified relationship is freely estimated +#' * `EPC`: The expected parameter estimate between \code{modV1} and \code{modV2} if freed. +#' * `Std_EPC`: The EPC value standardized using the variances of the continuous latent variables. +#' * `StdYX_EPC`: The EPC value standardized using the variances of the continuous latent variables as well as the variances of the background and/or outcome variables. #' @author Michael Hallquist #' @seealso \code{\link{readModels}}, \code{\link{extractModelSummaries}}, \code{\link{extractModelParameters}} #' @keywords internal diff --git a/R/extractParameters.R b/R/extractParameters.R index 061f019..f043d3f 100644 --- a/R/extractParameters.R +++ b/R/extractParameters.R @@ -741,40 +741,40 @@ extractParameters_1file <- function(outfiletext, filename, resultType, efa = FAL #' #' The core \code{data.frame} for each MODEL RESULTS section typically has the following structure: #' -#' \item{paramHeader}{The header that begins a given parameter set. Example: "FACTOR1 BY"} -#' \item{param}{The particular parameter being measured (within \code{paramHeader}). Example: "ITEM1"} -#' \item{est}{Parameter estimate value.} -#' \item{se}{Standard error of the estimate} -#' \item{est_se}{Quotient of \code{est/se}, representing z-test/t-test in large samples} -#' \item{pval}{Two-tailed p-value for the \code{est_se} quotient.} +#' * `paramHeader`: The header that begins a given parameter set. Example: "FACTOR1 BY" +#' * `param`: The particular parameter being measured (within \code{paramHeader}). Example: "ITEM1" +#' * `est`: Parameter estimate value. +#' * `se`: Standard error of the estimate +#' * `est_se`: Quotient of \code{est/se}, representing z-test/t-test in large samples +#' * `pval`: Two-tailed p-value for the \code{est_se} quotient. #' #' In the case of output from Bayesian estimation (ESTIMATOR=BAYES), the \code{data.frame} will contain #' a different set of variables, including some of the above, as well as -#' \item{posterior_sd}{Posterior standard deviation of the estimate.} -#' \item{lower_2.5ci}{Lower 2.5 percentile of the estimate.} -#' \item{upper_2.5ci}{Upper 2.5 percentile (aka 97.5 percentile) of the estimate.} +#' * `posterior_sd`: Posterior standard deviation of the estimate. +#' * `lower_2.5ci`: Lower 2.5 percentile of the estimate. +#' * `upper_2.5ci`: Upper 2.5 percentile (aka 97.5 percentile) of the estimate. #' #' Also note that the \code{pval} column for Bayesian output represents a one-tailed estimate. #' #' In the case of output from a Monte Carlo study (MONTECARLO: and MODEL POPULATION:), the \code{data.frame} will contain #' a different set of variables, including some of the above, as well as -#' \item{population}{Population parameter value.} -#' \item{average}{Average parameter estimate across replications.} -#' \item{population_sd}{Standard deviation of parameter value in population across replications.} -#' \item{average_se}{Average standard error of estimated parameter value across replications.} -#' \item{mse}{Mean squared error.} -#' \item{cover_95}{Proportion of replications whose 95\% confidence interval for the parameter includes the population value.} -#' \item{pct_sig_coef}{Proportion of replications for which the two-tailed significance test of the parameter is significant (p < .05).} +#' * `population`: Population parameter value. +#' * `average`: Average parameter estimate across replications. +#' * `population_sd`: Standard deviation of parameter value in population across replications. +#' * `average_se`: Average standard error of estimated parameter value across replications. +#' * `mse`: Mean squared error. +#' * `cover_95`: Proportion of replications whose 95\% confidence interval for the parameter includes the population value. +#' * `pct_sig_coef`: Proportion of replications for which the two-tailed significance test of the parameter is significant (p < .05). #' #' In the case of confidence interval output (OUTPUT:CINTERVAL), the list element \code{ci.unstandardized} will contain #' a different set of variables, including some of the above, as well as -#' \item{low.5}{Lower 0.5\% CI estimate.} -#' \item{low2.5}{Lower 2.5\% CI estimate.} -#' \item{low5}{Lower 5\% CI estimate.} -#' \item{est}{Parameter estimate value.} -#' \item{up5}{Upper 5\% (i.e., 95\%) CI estimate.} -#' \item{up2.5}{Upper 2.5\% (i.e., 97.5\%) CI estimate.} -#' \item{up.5}{Upper 0.5\% (i.e., 99.5\%) CI estimate.} +#' * `low.5`: Lower 0.5\% CI estimate. +#' * `low2.5`: Lower 2.5\% CI estimate. +#' * `low5`: Lower 5\% CI estimate. +#' * `est`: Parameter estimate value. +#' * `up5`: Upper 5\% (i.e., 95\%) CI estimate. +#' * `up2.5`: Upper 2.5\% (i.e., 97.5\%) CI estimate. +#' * `up.5`: Upper 0.5\% (i.e., 99.5\%) CI estimate. #' #' If the model contains multiple latent classes, an additional variable, \code{LatentClass}, #' will be included, specifying the latent class number. Also, the Categorical Latent Variables section @@ -803,4 +803,4 @@ extractModelParameters <- function(target=getwd(), recursive=FALSE, filefilter, #extractParameters_1section: extract model parameters for a given section. #extractParameters_1chunk: extract model parameters for a given chunk (e.g., Latent class 2, Between Level) within a given section. -} \ No newline at end of file +} diff --git a/R/extractSaveData.R b/R/extractSaveData.R index 428f149..be16289 100644 --- a/R/extractSaveData.R +++ b/R/extractSaveData.R @@ -9,15 +9,14 @@ #' If \code{outfile} is a relative path or just the filename, then it is assumed that the file resides in #' the working directory \code{getwd()}. #' @return Returns a list of SAVEDATA file information that includes: -#' \item{fileName}{The name of the file containing the analysis dataset created by the Mplus SAVEDATA command.} -#' \item{fileVarNames}{A character vector containing the names of variables in the dataset.} -#' \item{fileVarFormats}{A character vector containing the Fortran-style formats of variables in the dataset.} -#' \item{fileVarWidths}{A numeric vector containing the widths of variables in the dataset (which is stored in fixed-width format).} -#' \item{bayesFile}{The name of the BPARAMETERS file containing draws from the posterior distribution created by -#' the Mplus SAVEDATA BPARAMETERS command.} -#' \item{bayesVarNames}{A character vector containing the names of variables in the BPARAMETERS dataset.} -#' \item{tech3File}{A character vector of the tech 3 output.} -#' \item{tech4File}{A character vector of the tech 4 output.} +#' * `fileName`: The name of the file containing the analysis dataset created by the Mplus SAVEDATA command. +#' * `fileVarNames`: A character vector containing the names of variables in the dataset. +#' * `fileVarFormats`: A character vector containing the Fortran-style formats of variables in the dataset. +#' * `fileVarWidths`: A numeric vector containing the widths of variables in the dataset (which is stored in fixed-width format). +#' * `bayesFile`: The name of the BPARAMETERS file containing draws from the posterior distribution created by the Mplus SAVEDATA BPARAMETERS command. +#' * `bayesVarNames`: A character vector containing the names of variables in the BPARAMETERS dataset. +#' * `tech3File`: A character vector of the tech 3 output. +#' * `tech4File`: A character vector of the tech 4 output. #' @author Michael Hallquist #' @seealso \code{\link{getSavedata_Data}} #' @examples @@ -55,15 +54,14 @@ getSavedata_Fileinfo <- function(outfile) { #' output file. #' @param outfiletext The contents of the output file, for example as read by \code{scan} #' @return A list that includes: -#' \item{fileName}{The name of the file containing the analysis dataset created by the Mplus SAVEDATA command.} -#' \item{fileVarNames}{A character vector containing the names of variables in the dataset.} -#' \item{fileVarFormats}{A character vector containing the Fortran-style formats of variables in the dataset.} -#' \item{fileVarWidths}{A numeric vector containing the widths of variables in the dataset (which is stored in fixed-width format).} -#' \item{bayesFile}{The name of the BPARAMETERS file containing draws from the posterior distribution created by -#' the Mplus SAVEDATA BPARAMETERS command.} -#' \item{bayesVarNames}{A character vector containing the names of variables in the BPARAMETERS dataset.} -#' \item{tech3File}{A character vector of the tech 3 output.} -#' \item{tech4File}{A character vector of the tech 4 output.} +#' * `fileName`: The name of the file containing the analysis dataset created by the Mplus SAVEDATA command. +#' * `fileVarNames`: A character vector containing the names of variables in the dataset. +#' * `fileVarFormats`: A character vector containing the Fortran-style formats of variables in the dataset. +#' * `fileVarWidths`: A numeric vector containing the widths of variables in the dataset (which is stored in fixed-width format). +#' * `bayesFile`: The name of the BPARAMETERS file containing draws from the posterior distribution created by the Mplus SAVEDATA BPARAMETERS command. +#' * `bayesVarNames`: A character vector containing the names of variables in the BPARAMETERS dataset. +#' * `tech3File`: A character vector of the tech 3 output. +#' * `tech4File`: A character vector of the tech 4 output. #' @importFrom gsubfn strapply #' @seealso \code{\link{getSavedata_Data}} #' @examples diff --git a/R/mplus.R b/R/mplus.R index 530fbc8..3dd7b72 100644 --- a/R/mplus.R +++ b/R/mplus.R @@ -153,27 +153,27 @@ detectVariables <- function(object, quiet = TRUE) { #' @param ... Arguments passed on to \code{\link{mplusModeler}} if #' \code{run > 0}. #' @return A list of class \code{mplusObject} with elements -#' \item{TITLE}{The title in Mplus (if defined)} -#' \item{DATA}{The data section in Mplus (if defined)} -#' \item{VARIABLE}{The variable section in Mplus (if defined)} -#' \item{DEFINE}{The define section in Mplus (if defined)} -#' \item{MONTECARLO}{The montecarlo section in Mplus (if defined)} -#' \item{MODELPOPULATION}{The modelpopulation section in Mplus (if defined)} -#' \item{MODELMISSING}{The modelmissing section in Mplus (if defined)} -#' \item{ANALYSIS}{The analysis section in Mplus (if defined)} -#' \item{MODEL}{The model section in Mplus (if defined)} -#' \item{MODELINDIRECT}{The modelindirect section in Mplus (if defined)} -#' \item{MODELCONSTRAINT}{The modelconstraint section in Mplus (if defined)} -#' \item{MODELTEST}{The modeltest section in Mplus (if defined)} -#' \item{MODELPRIORS}{The modelpriors section in Mplus (if defined)} -#' \item{OUTPUT}{The output section in Mplus (if defined)} -#' \item{SAVEDATA}{The savedata section in Mplus (if defined)} -#' \item{PLOT}{The plot section in Mplus (if defined)} -#' \item{results}{NULL by default, but can be later updated to include the results from the model run.} -#' \item{usevariables}{A character vector of the variables from the \code{R} data set to be used.} -#' \item{rdata}{The \code{R} data set to use for the model.} -#' \item{imputed}{A logical whether the data are multiply imputed.} -#' \item{autov}{A logical whether the data should have the usevariables detected automatically or not} +#' * `TITLE`: The title in Mplus (if defined) +#' * `DATA`: The data section in Mplus (if defined) +#' * `VARIABLE`: The variable section in Mplus (if defined) +#' * `DEFINE`: The define section in Mplus (if defined) +#' * `MONTECARLO`: The montecarlo section in Mplus (if defined) +#' * `MODELPOPULATION`: The modelpopulation section in Mplus (if defined) +#' * `MODELMISSING`: The modelmissing section in Mplus (if defined) +#' * `ANALYSIS`: The analysis section in Mplus (if defined) +#' * `MODEL`: The model section in Mplus (if defined) +#' * `MODELINDIRECT`: The modelindirect section in Mplus (if defined) +#' * `MODELCONSTRAINT`: The modelconstraint section in Mplus (if defined) +#' * `MODELTEST`: The modeltest section in Mplus (if defined) +#' * `MODELPRIORS`: The modelpriors section in Mplus (if defined) +#' * `OUTPUT`: The output section in Mplus (if defined) +#' * `SAVEDATA`: The savedata section in Mplus (if defined) +#' * `PLOT`: The plot section in Mplus (if defined) +#' * `results`: NULL by default, but can be later updated to include the results from the model run. +#' * `usevariables`: A character vector of the variables from the \code{R} data set to be used. +#' * `rdata`: The \code{R} data set to use for the model. +#' * `imputed`: A logical whether the data are multiply imputed. +#' * `autov`: A logical whether the data should have the usevariables detected automatically or not #' #' @author Joshua F. Wiley #' @export @@ -1020,12 +1020,10 @@ mplusModeler <- function(object, dataout, modelout, run = 0L, #' at the time of writing, Mplus does not allow more than 80 characters per row. #' Defaults to \code{FALSE}. #' @return A named character vector of class \sQuote{MplusRstructure} with four elements: -#' \item{all}{A character string collapsing all other sections.} -#' \item{Variances}{A character string containing all of the variances.} -#' \item{Covariances}{A character string containing all of the -#' covariances, properly labelled to allow constraints and the -#' autoregressive residual covariance structure.} -#' \item{Constraints}{A character string containing the \sQuote{MODEL CONSTRAINT} +#' * `all`: A character string collapsing all other sections. +#' * `Variances`: A character string containing all of the variances. +#' * `Covariances`: A character string containing all of the covariances, properly labelled to allow constraints and the autoregressive residual covariance structure. +#' * `Constraints`: A character string containing the \sQuote{MODEL CONSTRAINT #' section and code needed to parameterize the residual covariance structure #' as autoregressive.} #' @keywords interface diff --git a/R/parseOutput.R b/R/parseOutput.R index 21af0bf..b7b5073 100644 --- a/R/parseOutput.R +++ b/R/parseOutput.R @@ -500,8 +500,8 @@ divideIntoFields <- function(section.text, required) { #' @param filename The filename #' @param input The input #' @return A list with two elements -#' \item{errors}{Mplus Errors} -#' \item{warnings}{Mplus Warnings} +#' * `errors`: Mplus Errors +#' * `warnings`: Mplus Warnings #' @keywords internal #' @examples #' # make me!!! @@ -1047,56 +1047,56 @@ extractSummaries_1file <- function(outfiletext, filename, input) #' #' @return Returns a \code{data.frame} containing model fit statistics for all output files within \code{directory}. #' The \code{data.frame} contains some of the following variables (depends on model type): -#' \item{Title}{Title for the model, specified by the TITLE: command} -#' \item{Filename}{Filename of the output file} -#' \item{Estimator}{Estimator used for the model (e.g., ML, MLR, WLSMV, etc.)} -#' \item{LL}{Log-likelihood of the model} -#' \item{BIC}{Bayesian Information Criterion} -#' \item{aBIC}{Sample-Size-Adjusted BIC (Sclove, 1987)} -#' \item{AIC}{Akaike's Information Criterion} -#' \item{AICC}{Corrected AIC, based on Sugiura (1978) and recommended by Burnham & Anderson (2002)} -#' \item{DIC}{Deviance Information Criterion. Available in ESTIMATOR=BAYES output.} -#' \item{Parameters}{Number of parameters estimated by the model} -#' \item{pD}{Estimated number of parameters in Bayesian output} -#' \item{Observations}{The number of observations for the model (does not suppport multiple-groups analysis at this time)} -#' \item{CFI}{Confirmatory Fit Index} -#' \item{TLI}{Tucker-Lewis Index} -#' \item{RMSEA_Estimate}{Point estimate of root mean squared error of approximation} -#' \item{RMSEA_90CI_LB}{Lower bound of the 90\% Confidence Interval around the RMSEA estimate.} -#' \item{RMSEA_90CI_UB}{Upper bound of the 90\% Confidence Interval around the RMSEA estimate.} -#' \item{RMSEA_pLT05}{Probability that the RMSEA estimate falls below .05, indicating good fit.} -#' \item{ChiSqM_Value}{Model chi-squared value} -#' \item{ChiSqM_DF}{Model chi-squared degrees of freedom} -#' \item{ChiSqM_PValue}{Model chi-squared p value} -#' \item{ChiSqM_ScalingCorrection}{H0 Scaling Correction Factor} -#' \item{ObsRepChiSqDiff_95CI_LB}{Lower bound of 95\% confidence interval for the difference between observed and replicated chi-square values} -#' \item{ObsRepChiSqDiff_95CI_UB}{Upper bound of 95\% confidence interval for the difference between observed and replicated chi-square values} -#' \item{PostPred_PValue}{Posterior predictive p-value} -#' \item{PriorPostPred_PValue}{Prior Posterior Predictive P-Value} -#' \item{BLRT_RequestedDraws}{Number of requested bootstrap draws for TECH14.} -#' \item{BLRT_KM1LL}{Log-likelihood of the K-1 model (one less class) for the Bootstrapped Likelihood Ratio Test (TECH14).} -#' \item{BLRT_2xLLDiff}{Two times the log-likelihood difference of the models with K and K-1 classes (TECH14).} -#' \item{BLRT_ParamDiff}{Difference in the number of parameters for models with K and K-1 classes (TECH14).} -#' \item{BLRT_PValue}{P-value of the Bootstrapped Likelihood Ratio Test (TECH14) testing whether the K class model is significantly better than K-1} -#' \item{BLRT_SuccessfulDraws}{The number of successful bootstrapped samples used in the Bootstrapped Likelihood Ratio Test} -#' \item{SRMR}{Standardized root mean square residual} -#' \item{SRMR.Between}{For TYPE=TWOLEVEL output, standardized root mean square residual for between level} -#' \item{SRMR.Within}{For TYPE=TWOLEVEL output, standardized root mean square residual for within level} -#' \item{WRMR}{Weighted root mean square residual} -#' \item{ChiSqBaseline_Value}{Baseline (unstructured) chi-squared value} -#' \item{ChiSqBaseline_DF}{Baseline (unstructured) chi-squared degrees of freedom} -#' \item{ChiSqBaseline_PValue}{Baseline (unstructured) chi-squared p value} -#' \item{NumFactors}{For TYPE=EFA output, the number of factors} -#' \item{T11_KM1Starts}{TECH11: Number of initial stage random starts for k-1 model} -#' \item{T11_KM1Final}{TECH11: Number of final stage optimizations for k-1 model} -#' \item{T11_KM1LL}{TECH11: Log-likelihood of the K-1 model used for the Vuong-Lo-Mendell-Rubin LRT} -#' \item{T11_VLMR_2xLLDiff}{TECH11: 2 * Log-likelihood Difference of K-class vs. K-1-class model for the Vuong-Lo-Mendell-Rubin LRT} -#' \item{T11_VLMR_ParamDiff}{TECH11: Difference in number of parameters between K-class and K-1-class model for the Vuong-Lo-Mendell-Rubin LRT} -#' \item{T11_VLMR_Mean}{TECH11: Vuong-Lo-Mendell-Rubin LRT mean} -#' \item{T11_VLMR_SD}{TECH11: Vuong-Lo-Mendell-Rubin LRT standard deviation} -#' \item{T11_VLMR_PValue}{TECH11: Vuong-Lo-Mendell-Rubin LRT p-value} -#' \item{T11_LMR_Value}{TECH11: Lo-Mendell-Rubin Adjusted LRT value} -#' \item{T11_LMR_PValue}{TECH11: Lo-Mendell-Rubin Adjusted LRT p-value} +#' * `Title`: Title for the model, specified by the TITLE: command +#' * `Filename`: Filename of the output file +#' * `Estimator`: Estimator used for the model (e.g., ML, MLR, WLSMV, etc.) +#' * `LL`: Log-likelihood of the model +#' * `BIC`: Bayesian Information Criterion +#' * `aBIC`: Sample-Size-Adjusted BIC (Sclove, 1987) +#' * `AIC`: Akaike's Information Criterion +#' * `AICC`: Corrected AIC, based on Sugiura (1978) and recommended by Burnham & Anderson (2002) +#' * `DIC`: Deviance Information Criterion. Available in ESTIMATOR=BAYES output. +#' * `Parameters`: Number of parameters estimated by the model +#' * `pD`: Estimated number of parameters in Bayesian output +#' * `Observations`: The number of observations for the model (does not suppport multiple-groups analysis at this time) +#' * `CFI`: Confirmatory Fit Index +#' * `TLI`: Tucker-Lewis Index +#' * `RMSEA_Estimate`: Point estimate of root mean squared error of approximation +#' * `RMSEA_90CI_LB`: Lower bound of the 90\% Confidence Interval around the RMSEA estimate. +#' * `RMSEA_90CI_UB`: Upper bound of the 90\% Confidence Interval around the RMSEA estimate. +#' * `RMSEA_pLT05`: Probability that the RMSEA estimate falls below .05, indicating good fit. +#' * `ChiSqM_Value`: Model chi-squared value +#' * `ChiSqM_DF`: Model chi-squared degrees of freedom +#' * `ChiSqM_PValue`: Model chi-squared p value +#' * `ChiSqM_ScalingCorrection`: H0 Scaling Correction Factor +#' * `ObsRepChiSqDiff_95CI_LB`: Lower bound of 95\% confidence interval for the difference between observed and replicated chi-square values +#' * `ObsRepChiSqDiff_95CI_UB`: Upper bound of 95\% confidence interval for the difference between observed and replicated chi-square values +#' * `PostPred_PValue`: Posterior predictive p-value +#' * `PriorPostPred_PValue`: Prior Posterior Predictive P-Value +#' * `BLRT_RequestedDraws`: Number of requested bootstrap draws for TECH14. +#' * `BLRT_KM1LL`: Log-likelihood of the K-1 model (one less class) for the Bootstrapped Likelihood Ratio Test (TECH14). +#' * `BLRT_2xLLDiff`: Two times the log-likelihood difference of the models with K and K-1 classes (TECH14). +#' * `BLRT_ParamDiff`: Difference in the number of parameters for models with K and K-1 classes (TECH14). +#' * `BLRT_PValue`: P-value of the Bootstrapped Likelihood Ratio Test (TECH14) testing whether the K class model is significantly better than K-1 +#' * `BLRT_SuccessfulDraws`: The number of successful bootstrapped samples used in the Bootstrapped Likelihood Ratio Test +#' * `SRMR`: Standardized root mean square residual +#' * `SRMR.Between`: For TYPE=TWOLEVEL output, standardized root mean square residual for between level +#' * `SRMR.Within`: For TYPE=TWOLEVEL output, standardized root mean square residual for within level +#' * `WRMR`: Weighted root mean square residual +#' * `ChiSqBaseline_Value`: Baseline (unstructured) chi-squared value +#' * `ChiSqBaseline_DF`: Baseline (unstructured) chi-squared degrees of freedom +#' * `ChiSqBaseline_PValue`: Baseline (unstructured) chi-squared p value +#' * `NumFactors`: For TYPE=EFA output, the number of factors +#' * `T11_KM1Starts`: TECH11: Number of initial stage random starts for k-1 model +#' * `T11_KM1Final`: TECH11: Number of final stage optimizations for k-1 model +#' * `T11_KM1LL`: TECH11: Log-likelihood of the K-1 model used for the Vuong-Lo-Mendell-Rubin LRT +#' * `T11_VLMR_2xLLDiff`: TECH11: 2 * Log-likelihood Difference of K-class vs. K-1-class model for the Vuong-Lo-Mendell-Rubin LRT +#' * `T11_VLMR_ParamDiff`: TECH11: Difference in number of parameters between K-class and K-1-class model for the Vuong-Lo-Mendell-Rubin LRT +#' * `T11_VLMR_Mean`: TECH11: Vuong-Lo-Mendell-Rubin LRT mean +#' * `T11_VLMR_SD`: TECH11: Vuong-Lo-Mendell-Rubin LRT standard deviation +#' * `T11_VLMR_PValue`: TECH11: Vuong-Lo-Mendell-Rubin LRT p-value +#' * `T11_LMR_Value`: TECH11: Lo-Mendell-Rubin Adjusted LRT value +#' * `T11_LMR_PValue`: TECH11: Lo-Mendell-Rubin Adjusted LRT p-value #' #' @author Michael Hallquist #' @seealso \code{\link{regex}}, \code{\link{runModels}}, \code{\link{readModels}} diff --git a/R/readModels.R b/R/readModels.R index c1790c6..7a84180 100644 --- a/R/readModels.R +++ b/R/readModels.R @@ -41,36 +41,35 @@ #' elements containing major output sections, as detailed below. If #' \code{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: -#' \item{input}{Mplus input syntax parsed into a list by major section} -#' \item{warnings}{Syntax and estimation warnings as a list} -#' \item{errors}{Syntax and estimation errors as a list} -#' \item{data_summary}{Output of SUMMARY OF DATA section, including cluster sizes and ICCs} -#' \item{sampstat}{Sample statistics provided by OUTPUT: SAMPSTAT, if specified} -#' \item{covariance_coverage}{Covariance coverage matrix for checking missingness patterns} -#' \item{summaries}{Summary statistics from \code{extractModelSummaries}, having structure as specified by that function} -#' \item{parameters}{Model parameters from \code{extractModelParameters}, having structure as specified by that function} -#' \item{class_counts}{Latent class counts and proportions for models that include a categorical latent variable} -#' \item{indirect}{Output of MODEL INDIRECT if available in output. Contains \code{$overall} and \code{$specific} data.frames for each indirect effect section} -#' \item{mod_indices}{Model modification indices from \code{extractModIndices}, having structure as specified by that function} -#' \item{residuals}{a list containing relevant information from OUTPUT: RESIDUALS} -#' \item{savedata_info}{File information about SAVEDATA files related to this output} -#' \item{savedata}{SAVEDATA file as an R \code{data.frame}, as described in \code{getSavedata_Data}} -#' \item{bparameters}{an \code{mcmc.list} object containing the draws from the MCMC chains for a Bayesian model that uses the -#' SAVEDATA: BPARAMETERS command} -#' \item{tech1}{a list containing parameter specification and starting values from OUTPUT: TECH1} -#' \item{tech3}{a list containing parameter covariance and correlation matrices from OUTPUT: TECH3} -#' \item{tech4}{a list containing means, covariances, and correlations for latent variables from OUTPUT: TECH4} -#' \item{tech7}{a list containing sample statistics for each latent class from OUTPUT: TECH7} -#' \item{tech8}{a list containing optimization history of the model. Currently only supports potential scale reduction in BAYES. OUTPUT: TECH8} -#' \item{tech9}{a list containing warnings/errors from replication runs for MONTECARLO analyses from OUTPUT: TECH9} -#' \item{tech10}{a list containing model fit information from OUTPUT: TECH10} -#' \item{tech12}{a list containing observed versus estimated sample statistics for TYPE=MIXTURE analyses from OUTPUT: TECH12} -#' \item{fac_score_stats}{factor score mean, correlation, and covariance structure from SAMPLE STATISTICS FOR ESTIMATED FACTOR SCORES section} -#' \item{lcCondMeans}{conditional latent class means and pairwise comparisons, obtained using auxiliary(e) syntax in latent class models} -#' \item{r3step}{predictors of latent class membership using the 3-step procedure (R3STEP)} -#' \item{gh5}{a list containing data from the gh5 (graphics) file corresponding to this output. (Requires rhdf5 package)} -#' \item{h5results}{a list containing data from h5results file produced by Mplus v8.11+. (Requires rhdf5 package)} -#' \item{output}{The entire, raw output file.} +#' * `input`: Mplus input syntax parsed into a list by major section +#' * `warnings`: Syntax and estimation warnings as a list +#' * `errors`: Syntax and estimation errors as a list +#' * `data_summary`: Output of SUMMARY OF DATA section, including cluster sizes and ICCs +#' * `sampstat`: Sample statistics provided by OUTPUT: SAMPSTAT, if specified +#' * `covariance_coverage`: Covariance coverage matrix for checking missingness patterns +#' * `summaries`: Summary statistics from \code{extractModelSummaries}, having structure as specified by that function +#' * `parameters`: Model parameters from \code{extractModelParameters}, having structure as specified by that function +#' * `class_counts`: Latent class counts and proportions for models that include a categorical latent variable +#' * `indirect`: Output of MODEL INDIRECT if available in output. Contains \code{$overall} and \code{$specific} data.frames for each indirect effect section +#' * `mod_indices`: Model modification indices from \code{extractModIndices}, having structure as specified by that function +#' * `residuals`: a list containing relevant information from OUTPUT: RESIDUALS +#' * `savedata_info`: File information about SAVEDATA files related to this output +#' * `savedata`: SAVEDATA file as an R \code{data.frame}, as described in \code{getSavedata_Data} +#' * `bparameters`: an \code{mcmc.list} object containing the draws from the MCMC chains for a Bayesian model that uses the SAVEDATA: BPARAMETERS command +#' * `tech1`: a list containing parameter specification and starting values from OUTPUT: TECH1 +#' * `tech3`: a list containing parameter covariance and correlation matrices from OUTPUT: TECH3 +#' * `tech4`: a list containing means, covariances, and correlations for latent variables from OUTPUT: TECH4 +#' * `tech7`: a list containing sample statistics for each latent class from OUTPUT: TECH7 +#' * `tech8`: a list containing optimization history of the model. Currently only supports potential scale reduction in BAYES. OUTPUT: TECH8 +#' * `tech9`: a list containing warnings/errors from replication runs for MONTECARLO analyses from OUTPUT: TECH9 +#' * `tech10`: a list containing model fit information from OUTPUT: TECH10 +#' * `tech12`: a list containing observed versus estimated sample statistics for TYPE=MIXTURE analyses from OUTPUT: TECH12 +#' * `fac_score_stats`: factor score mean, correlation, and covariance structure from SAMPLE STATISTICS FOR ESTIMATED FACTOR SCORES section +#' * `lcCondMeans`: conditional latent class means and pairwise comparisons, obtained using auxiliary(e) syntax in latent class models +#' * `r3step`: predictors of latent class membership using the 3-step procedure (R3STEP) +#' * `gh5`: a list containing data from the gh5 (graphics) file corresponding to this output. (Requires rhdf5 package) +#' * `h5results`: a list containing data from h5results file produced by Mplus v8.11+. (Requires rhdf5 package) +#' * `output`: The entire, raw output file. #' @author Michael Hallquist #' @keywords interface #' @export