The mimic= option
mimic.RdThe 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
Mplusprogram (also selected by the value"mplus")."EQS":mimic the
EQSprogram (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 byN(rather thanN-1).conditional.x = FALSE:the exogenous
xcovariates are regressed out first, and a conditional (on x) model is fitted.fixed.x = TRUE:the means, variances and covariances of the exogenous
xcovariates are fixed to their sample values (for the ML, MML and IV estimator groups, unlessstart = "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 ofN), 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.
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
#> lavaan 0.7-1.3097 ended normally after 35 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 21
#>
#> Number of observations 301
#>
#> Model Test User Model:
#> Standard Scaled
#> Test Statistic 85.306 80.872
#> Degrees of freedom 24 24
#> P-value (Chi-square) 0.000 0.000
#> Scaling correction factor 1.055
#> Satorra-Bentler correction
# 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
#> lavaan 0.7-1.3097 ended normally after 35 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 30
#>
#> Number of observations 301
#>
#> Model Test User Model:
#> Standard Scaled
#> Test Statistic 85.306 81.908
#> Degrees of freedom 24 24
#> P-value (Chi-square) 0.000 0.000
#> Scaling correction factor 1.041
#> Satorra-Bentler correction (Mplus variant)
# 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 0.7-1.3097 ended normally after 35 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 21
#>
#> Number of observations 301
#>
#> Model Test User Model:
#> Standard Scaled
#> Test Statistic 85.022 81.141
#> Degrees of freedom 24 24
#> P-value (Chi-square) 0.000 0.000
#> Scaling correction factor 1.048
#> Satorra-Bentler correction