Learn R Programming

MplusAutomation (version 0.6-1)

compareModels: Compare the output of two Mplus models

Description

The compareModels function compares the output of two Mplus files and prints similarities and differences in the model summary statistics and parameter estimates. Options are provided for filtering out fixed parameters and nonsignificant parameters. When requested, compareModels will compute the chi-square difference test for nested models (does not apply to MLMV, WLSM, and WLSMV estimators, where DIFFTEST in Mplus is needed). Model outputs to be compared can be full summaries and parameters (generated by readModels), summary statistics only (extractModelSummaries), or parameters only (extractModelParameters).

Usage

compareModels(m1, m2, show = "all",
    equalityMargin = c(param = 1e-04, pvalue = 1e-04),
    sort = "none", showFixed = FALSE, showNS = TRUE,
    diffTest = FALSE)

Arguments

m1
The first Mplus model to be compared. Generated by readModels, extractModelSummaries, or extractModelParameters.
m2
The second Mplus model to be compared.
show
What aspects of the models should be compared. Options are "all", "summaries", "equal", "diff", "pdiff", and "unique". See below for details.
equalityMargin
Defines the discrepancy between models that is considered equal. Different margins can be specified for p-value equality versus parameter equality. Defaults to .0001 for both.
sort
How to sort the output of parameter comparisons. Options are "none", "type", "alphabetical", and "maxDiff". See below for details.
showFixed
Whether to display fixed parameters in the output (identified where the est/se = 999.000, per Mplus convention). Default to FALSE.
showNS
Whether to display non-significant parameter estimates. Can be TRUE or FALSE, or a numeric value (e.g., .10) that defines what p-value is filtered as non-significant.
diffTest
Whether to compute a chi-square difference test between the models. Assumes that the models are nested. Not available for MLMV, WLSMV, and ULSMV estimators. Use DIFFTEST in Mplus instead.

Value

  • No value is returned by this function. It is used to print model differences to the R console.

Details

The show parameter can be one or more of the following, which can be passed as a vector, such as c("equal", "pdiff").

[object Object]

The sort parameter determines the order in which parameter estimates are displayed. The following options are available:

[object Object]

Examples

Run this code
# make me!!!

Run the code above in your browser using DataLab