parameterEstimates_boot {semboottools} | R Documentation |
Bootstrap CIs for Parameter Estimates
Description
Functions for forming bootstrap confidence intervals for the parameter estimates.
Usage
parameterEstimates_boot(
object,
level = 0.95,
boot_org_ratio = FALSE,
boot_ci_type = c("perc", "bc", "bca.simple"),
save_boot_est = TRUE,
boot_pvalue = TRUE,
boot_pvalue_min_size = 1000,
standardized = FALSE,
...
)
Arguments
object |
A 'lavaan'-class object, fitted with 'se = "boot"'. |
level |
The level of confidence of the confidence intervals. Default is .95. |
boot_org_ratio |
The ratio of
(a) the distance of the bootstrap
confidence limit from the point
estimate to (b) the distance of the
original confidence limit in
|
boot_ci_type |
The type of the
bootstrapping confidence intervals.
Support percentile confidence intervals
( |
save_boot_est |
Whether the
bootstrap estimates of the
parameter estimates are saved. If
saved, the bootstrap estimates
of the free parameters 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, |
standardized |
The type of standardized
estimates. The same argument of
|
... |
Other arguments to be
passed to
|
Details
parameterEstimates_boot()
receives a
lavaan::lavaan object and
form bootstrap confidence intervals
for the parameter estimates.
The function store_boot()
should
be called first to
compute and store bootstrap estimates.
This function will then retrieve them.
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.
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::parameterEstimates()
,
with bootstrap confidence intervals
appended to the right, with class
set to sbt_ustd_boot
. It has
a print method
(print.sbt_ustd_boot()
) that
can be used to print the parameter
estimates 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.
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::parameterEstimates()
, 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)
summary(fit)
fit <- store_boot(fit,
do_bootstrapping = TRUE,
R = 100,
iseed = 1234)
est <- parameterEstimates_boot(fit)
est