Learn R Programming

lavaan (version 0.7-2)

mimic: 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.

Arguments

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.

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.

baseline.fixed.x.free.cov = FALSE:

when fixed.x = TRUE, the baseline (independence) model does not free the (co)variances of the exogenous covariates.

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").

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

Run this code
# 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

Run the code above in your browser using DataLab