View source: R/print_delta_med.R
print.delta_med | R Documentation |
Print the content of
a delta_med
-class object.
## S3 method for class 'delta_med'
print(x, digits = 3, level = NULL, full = FALSE, boot_type, ...)
x |
A |
digits |
The number of digits after the decimal. Default is 3. |
level |
The level of confidence
of bootstrap confidence interval,
if requested when created. If |
full |
Logical. Whether
additional information will be printed.
Default is |
boot_type |
If bootstrap
confidence interval is to be formed,
the type of bootstrap confidence
interval. The supported types
are |
... |
Optional arguments. Ignored. |
It prints the output of
delta_med()
, which is a
delta_med
-class object.
x
is returned invisibly. Called
for its side effect.
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
delta_med()
library(lavaan)
dat <- data_med
mod <-
"
m ~ x
y ~ m + x
"
fit <- sem(mod, dat)
dm <- delta_med(x = "x",
y = "y",
m = "m",
fit = fit)
dm
print(dm, full = TRUE)
# Call do_boot() to generate
# bootstrap estimates
# Use 2000 or even 5000 for R in real studies
# Set parallel to TRUE in real studies for faster bootstrapping
boot_out <- do_boot(fit,
R = 45,
seed = 879,
parallel = FALSE,
progress = FALSE)
# Remove 'progress = FALSE' in practice
dm_boot <- delta_med(x = "x",
y = "y",
m = "m",
fit = fit,
boot_out = boot_out,
progress = FALSE)
dm_boot
confint(dm_boot)
confint(dm_boot,
level = .90)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.