mimic: The mimic= option

mimicR Documentation

The mimic= option

Description

The mimic= argument of the lavaan function (and its wrappers cfa, sem and growth) controls a collection of primarily technical default settings, with the aim of making lavaan's output as similar as possible to that of other SEM software. This applies in particular to a few key results, such as the value of the Satorra-Bentler scaled test statistic.

The mimic= option was originally introduced to demonstrate that differences between lavaan and other SEM programs were often due to technical implementation details rather than errors in lavaan. Nevertheless, the scope of the mimic= option is intentionally limited. It is designed to reproduce a small number of important results and does not attempt to replicate every quantity reported by alternative SEM software packages.

This help page documents which options are affected by the mimic= argument.

Details

The mimic= argument does not change the model that is fitted, nor the estimator that is used. Instead, it overwrites the default values of a number of (mostly technical) options that are otherwise estimator-dependent. The user can always override these defaults by setting the corresponding option explicitly in the lavaan call.

The argument is case-insensitive and accepts a number of aliases. After normalization, only four values remain:

"lavaan":

the native lavaan defaults (also selected by the value "default"); this is the default.

"Mplus":

mimic the Mplus program (also selected by the value "mplus").

"EQS":

mimic the EQS program (also selected by the values "eqs", "LISREL" and "lisrel").

"lm":

a minimal setting used internally for plain regression (also selected by the value "regression"); not intended for general use.

mimic = "lavaan" (the default)

This is the reference setting. For maximum likelihood (ML) estimation, the following defaults are used:

likelihood = "normal":

the sample covariance matrix is rescaled by a factor (N-1)/N, so the loglikelihood and standard errors are based on a division by N (rather than N-1).

conditional_x = FALSE:

the exogenous x covariates are regressed out first, and a conditional (on x) model is fitted.

fixed_x = TRUE:

the means, variances and covariances of the exogenous x covariates are fixed to their sample values (for the ML, MML and IV estimator groups, unless start = "simple").

zero_keep_margins = TRUE:

for categorical data, the (one-way) margins are preserved when adding a small constant to empty cells.

In addition, the various Mplus-specific technical options (information_expected_mplus, gamma_vcov_mplus, gamma_wls_mplus, gls_v11_mplus and rmsea_scaled_mplus) are all set to FALSE.

mimic = "Mplus"

Starting from the lavaan defaults, the following options are changed in an attempt to reproduce the output of Mplus:

information_expected_mplus = TRUE:

use the Mplus variant of the expected information matrix. This affects the standard errors (when information = "expected") and the scaled (Satorra-Bentler and Yuan-Bentler) test statistics.

gamma_vcov_mplus = TRUE:

use the Mplus way of computing the \Gamma matrix (the asymptotic covariance matrix of the sample statistics) that enters the robust (sandwich) standard errors.

gamma_wls_mplus = TRUE:

use the Mplus way of computing the \Gamma matrix used as the weight matrix in (D)WLS estimation.

gls_v11_mplus = TRUE:

use the Mplus variant of the weight matrix used in GLS estimation (when there is a meanstructure and conditional_x = FALSE).

rmsea_scaled_mplus = TRUE:

use the Mplus reference distribution for the scaled RMSEA confidence interval and p-values. lavaan refers the unscaled test statistic to a chi-square distribution with tr[U\Gamma] degrees of freedom, while Mplus refers the scaled statistic to a chi-square distribution with the degrees of freedom of the scaled test. Both match the mean of the null distribution, but on a different scale, so they yield different intervals and p-values. This only affects the Satorra-Bentler and Yuan-Bentler family (MLM, MLR, MLMVS, WLSM, ...); for the shifted family (MLMV, WLSMV, ULSMV) lavaan already uses the Mplus convention.

missing = "ml":

for continuous data and the ML or MLR estimator, the default missing-data handling becomes full information maximum likelihood (FIML), rather than listwise deletion.

meanstructure = TRUE:

a meanstructure is added by default (unless the estimator is PML).

group_equal:

in a multiple-group analysis, if no equality constraints are requested, a default set is imposed: "loadings" and "thresholds" for categorical data; "loadings" for continuous data without a meanstructure; and "loadings" and "intercepts" for continuous data with a meanstructure.

baseline_conditional_x_free_slopes = FALSE:

when conditional_x = TRUE, the baseline (independence) model does not free the slope structure.

mixed numeric/ordinal data:

in the three-stage (D)WLS approach, the asymptotic covariance matrix of the sample statistics (and the (D)WLS weight matrix) involves the matrix of derivatives of the stage-1/2 estimating equations. For the numeric variables, lavaan uses the analytic information (means, slopes, variances) and the observed second-order derivatives of the bivariate (pearson, polyserial) loglikelihoods, which remain valid if the numeric variables are not normally distributed. Mplus (and lavaan before 0.7-3) replaces all these derivatives by crossproducts of the scores (the information identity), which is only valid under normality of the numeric variables. For purely ordinal data, both approaches coincide.

The likelihood, conditional_x, fixed_x and zero_keep_margins defaults are the same as for mimic = "lavaan".

mimic = "EQS"

Starting from the lavaan defaults, the following options are changed in an attempt to reproduce the output of EQS (the value "LISREL" is treated as an alias for "EQS"):

likelihood = "wishart":

for ML estimation, the Wishart likelihood is used. The sample covariance matrix is divided by N-1 (instead of N), which affects the chi-square test statistic, the loglikelihood and the standard errors.

fixed_x = FALSE:

the exogenous x covariates are treated as random variables: their means, variances and covariances are freely estimated (rather than fixed to their sample values).

baseline_fixed_x_free_cov = FALSE:

the covariances among the exogenous covariates are constrained to zero in the baseline (independence) model, just like all other covariances. By default, they are retained (freely estimated if fixed_x = FALSE, fixed to their sample values if fixed_x = TRUE), which yields a smaller baseline chi-square statistic.

In addition, for the MLR estimator, the robust test statistic defaults to "yuan.bentler" (instead of the "yuan.bentler.mplus" variant that is used for mimic = "lavaan" and mimic = "Mplus"). The conditional_x and zero_keep_margins defaults are the same as for mimic = "lavaan".

Note that the mimic= argument only sets defaults: any option that is set explicitly in the lavaan call takes precedence. The mimicking is also necessarily incomplete; small numerical differences with the target program may remain.

See Also

lavOptions, lavaan

Examples

# default (mimic = "lavaan")
fit1 <- cfa(" visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 ",
            test = "satorra.bentler",
            missing = "listwise",
            data = HolzingerSwineford1939)
fit1

# mimic the Mplus program
fit2 <- cfa(" visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 ",
            test = "satorra.bentler",
            missing = "listwise",
            data = HolzingerSwineford1939, mimic = "Mplus")
fit2

# mimic the EQS program
fit3 <- cfa(" visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 ",
            test = "satorra.bentler",
            missing = "listwise",
            data = HolzingerSwineford1939, mimic = "EQS")
fit3

lavaan documentation built on Oct. 8, 2026, 5:06 p.m.