standardizedSolution_boot {semboottools} | R Documentation |
Bootstrap CIs for Standardized Solution
Description
Functions for forming bootstrap confidence intervals for the standardized solution.
Usage
standardizedSolution_boot(
object,
level = 0.95,
type = "std.all",
boot_delta_ratio = FALSE,
boot_ci_type = c("perc", "bc", "bca.simple"),
save_boot_est_std = TRUE,
boot_pvalue = TRUE,
boot_pvalue_min_size = 1000,
...
)
Arguments
object |
A 'lavaan'-class object, fitted with 'se = "boot"'. |
level |
The level of confidence of the confidence intervals. Default is .95. |
type |
The type of standard
estimates. The same argument of
|
boot_delta_ratio |
The ratio of
(a) the distance of the bootstrap
confidence limit from the point
estimate to (b) the distance of the
delta-method limit from the point
estimate. Default is |
boot_ci_type |
The type of the
bootstrapping confidence intervals.
Support percentile confidence intervals
( |
save_boot_est_std |
Whether the
bootstrap estimates of the
standardized solution are saved. If
saved, they will be stored in the
attribute |
boot_pvalue |
Whether asymmetric
bootstrap p-values are computed.
Default is |
boot_pvalue_min_size |
Integer.
The asymmetric bootstrap p-values
will be computed only if the number
of valid bootstrap estimates is at
least this value. Otherwise, |
... |
Other arguments to be
passed to
|
Details
standardizedSolution_boot()
receives a
lavaan::lavaan object fitted
with bootstrapping standard errors
requested and forms the confidence
intervals for the standardized
solution.
It works by calling
lavaan::standardizedSolution()
with the bootstrap estimates
of free parameters in each bootstrap sample
to compute the standardized estimates
in each sample.
Alternative, call store_boot()
to
computes and store bootstrap estimates
of the standardized solution.
This function will then retrieve them,
even if se
was not set to
"boot"
or "bootstrap"
when fitting
the model.
Bootstrap Confidence Intervals
It supports percentile and bias-corrected bootstrap confidence intervals.
Bootstrap Standard Errors
The standard errors are the standard deviation of the bootstrap estimates, which can be different from the delta-method standard errors.
Bootstrap Asymmetric p-Values
If percentile bootstrap confidence interval is requested, asymmetric bootstrap p-values are also computed, using the method presented in Asparouhov and Muthén (2021).
Value
The output of
lavaan::standardizedSolution()
,
with bootstrap confidence intervals
appended to the right, with class
set to sbt_std_boot
. It has
a print method
(print.sbt_std_boot()
) that
can be used to print the standardized
solution in a format similar to
that of the printout of
the summary()
of a lavaan::lavaan object.
Author(s)
Shu Fai Cheung
https://orcid.org/0000-0002-9871-9448.
Originally proposed in an issue at GitHub
https://github.com/simsem/semTools/issues/101#issue-1021974657,
inspired by a discussion at
the Google group for lavaan
https://groups.google.com/g/lavaan/c/qQBXSz5cd0o/m/R8YT5HxNAgAJ.
boot::boot.ci()
is used to form the
percentile confidence intervals in
this version.
References
Asparouhov, A., & Muthén, B. (2021). Bootstrap p-value computation. Retrieved from https://www.statmodel.com/download/FAQ-Bootstrap%20-%20Pvalue.pdf
See Also
lavaan::standardizedSolution()
, store_boot()
Examples
library(lavaan)
set.seed(5478374)
n <- 50
x <- runif(n) - .5
m <- .40 * x + rnorm(n, 0, sqrt(1 - .40))
y <- .30 * m + rnorm(n, 0, sqrt(1 - .30))
dat <- data.frame(x = x, y = y, m = m)
model <-
'
m ~ a*x
y ~ b*m
ab := a*b
'
# Should set bootstrap to at least 2000 in real studies
fit <- sem(model, data = dat, fixed.x = FALSE,
se = "boot",
bootstrap = 100)
summary(fit)
std <- standardizedSolution_boot(fit)
std
# Print in a friendly format with only standardized solution
print(std, output = "text")
# Print in a friendly format with both unstandardized
# and standardized solution
print(std, output = "text", standardized_only = FALSE)
# hist_qq_boot() can be used to examine the bootstrap estimates
# of a parameter
hist_qq_boot(std, param = "ab")
# scatter_boot() can be used to examine the bootstrap estimates
# of two or more parameters
scatter_boot(std, params = c("ab", "a", "b"))