An object of class lavaan. The unrestricted
model.
R
Integer. The number of bootstrap draws.
type
If "ordinary" or "nonparametric", the usual
(naive) bootstrap method is used. If "bollen.stine", the
data is first transformed such that the null hypothesis holds exactly
in the resampling space. If "yuan", the data is first transformed
by combining data and theory (model), such that the resampling space
is closer to the population space.
If "parametric", the parametric bootstrap
approach is used; currently, this is only valid for continuous data
following a multivariate normal distribution. See references for more
details.
FUN
A function which when applied to the lavaan
object returns a vector containing the statistic(s) of interest.
The default is FUN="coef", returning the estimated values of the
free parameters in the model.
...
Other named arguments for FUN which are passed
unchanged each time it is called.
verbose
If TRUE, show information for each bootstrap draw.
warn
Sets the handling of warning messages. See options.
return.boot
Not used for now.
return.LRT
If TRUE, return the LRT values as an attribute to the pvalue.
parallel
The type of parallel operation to be used (if any). If
missing, the default is "no".
ncpus
Integer: number of processes to be used in parallel operation:
typically one would chose this to the number of available CPUs.
cl
An optional parallel or snow cluster for use if
parallel = "snow". If not supplied, a cluster on the local machine is
created for the duration of the bootstrapLavaan or bootstrapLRT
call.
h0.rmsea
Only used if type="yuan". Allows one to do the Yuan
bootstrap under the hypothesis that the population RMSEA equals a specified
value.
double.bootstrap
If "standard" the genuine double bootstrap is
used to compute an additional set of plug-in p-values for each boostrap sample.
If "FDB", the fast double bootstrap is used to compute second level
LRT-values for each bootstrap sample. If "no", no double bootstrap is
used. The default is set to "FDB".
double.bootstrap.R
Integer. The number of bootstrap draws to be use for
the double bootstrap.
double.bootstrap.alpha
The significance level to compute the adjusted
alpha based on the plugin p-values.
Details
The FUN function can return either a scalar or a numeric vector.
This function can be an existing function (for example coef) or
can be a custom defined function. For example:
If parallel="snow", it is imperative that the require(lavaan)
is included in the custom function.
Author(s)
Yves Rosseel, Leonard Vanbrabant and Ed Merkle
References
Bollen, K. and Stine, R. (1992) Bootstrapping Goodness of Fit Measures in
Structural Equation Models. Sociological Methods and Research, 21,
205–229.
Yuan, K.-H., Hayashi, K., & Yanagihara, H. (2007). A class of population
covariance matrices in the bootstrap approach to covariance structure analysis.
Multivariate Behavioral Research, 42, 261–281.
Examples
# fit the Holzinger and Swineford (1939) example
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data=HolzingerSwineford1939, se="none")
# get the test statistic for the original sample
T.orig <- fitMeasures(fit, "chisq")
# bootstrap to get bootstrap test statistics
# we only generate 10 bootstrap sample in this example; in practice
# you may wish to use a much higher number
T.boot <- bootstrapLavaan(fit, R=10, type="bollen.stine",
FUN=fitMeasures, fit.measures="chisq")
# compute a bootstrap based p-value
pvalue.boot <- length(which(T.boot > T.orig))/length(T.boot)