Important Notes
Starting from Version 0.2.7.5, of stdmod_lavaan() adopts an approach
to bootstrapping different from that in the previous
versions (0.2.7.4 and before),
yielding bootstrapping results different from those in
previous versions (for reasons explained later).
To reproduce results from the older version of this function,
set use_old_version to TRUE.
How it works
stdmod_lavaan() accepts a lavaan::lavaan object, the
structural equation model output returned
by lavaan::lavaan() and its wrappers (e.g, lavaan::sem()) and computes
the standardized moderation effect using the formula in the appendix of
Cheung, Cheung, Lau, Hui, and Vong (2022).
The standard deviations of the focal variable (the variable with its effect
on the outcome variable being moderated), moderator, and outcome
variable (dependent variable) are computed from the implied
covariance matrix returned by
lavaan::lavInspect(). Therefore, models fitted to data sets with missing
data (e.g., with missing = "fiml") are also supported.
Partial standardization can also be requested. For example, standardization
can be requested for only the focal variable and the outcome variable.
There are two ways to request nonparametric bootstrap
confidence interval. First, the model is fitted with se = "boot"
or se = "bootstrap" in lavaan. The stored bootstrap
estimates will then be retrieved automatically to compute the
standardized moderation effect. This is the most efficient approach
if the bootstrap confidence intervals are also needed for
other parameters in the model. Bootstrapping needs to be
done only once.
Second, bootstrap estimates can be generated by manymome::do_boot().
The output is then supplied through the argument boot_out.
Bootstrapping also only needs to be done once. This approach
is appropriate when bootstrapping confidence intervals are
not needed for other model parameters, or another type
of confidence interval is needed when fitting the model.
Please refer to the help page of manymome::do_boot()
on how to use this function.
In both approaches, the standard deviations are also computed
in each bootstrap samples. This ensures that the sampling
variability of the standard deviations is also taken into
account in computing the bootstrap confidence interval of
the standardized moderation effect.
Note on the differences between the current version (Version 0.2.7.5 or later) and previous versions (0.2.7.4 and before)
In older versions, stdmod_lavaan() does not allow for
partial standardization. Moreover,
it uses boot::boot() to do the bootstrapping. Even with
the same seed, the results from boot::boot() are not
identical to those of lavaan with se = "boot"
because they differ in the way the indices
of resampling are generated. Both approaches are correct,
They just use the generated random numbers differently.
To have results consistent with those from lavaan,
the current version of stdmod_lavaan() adopts a
resampling algorithm identical to that of lavaan.
Last, in older versions, stdmod_lavaan() does
bootstrapping every time it is called. This is
inefficient.
The bootstrapping results in the current version are not
identical to those in older versions due to the use
of different resampling algorithms, To reproduce
previous results, set use_old_version to TRUE