View source: R/print_cond_indirect_effect.R
print.cond_indirect_effects | R Documentation |
Print the content of the
output of cond_indirect_effects()
## S3 method for class 'cond_indirect_effects'
print(
x,
digits = 3,
annotation = TRUE,
pvalue = NULL,
pvalue_digits = 3,
se = NULL,
level = 0.95,
se_ci = TRUE,
...
)
x |
The output of
|
digits |
Number of digits to display. Default is 3. |
annotation |
Logical. Whether
the annotation after the table of
effects is to be printed. Default is
|
pvalue |
Logical. If |
pvalue_digits |
Number of decimal places to display for the p-values. Default is 3. |
se |
Logical. If |
level |
The level of confidence
for the confidence intervals computed
from the original standard errors. Used only for
paths without mediators and both
|
se_ci |
Logical. If |
... |
Other arguments. Not used. |
The print
method of the
cond_indirect_effects
-class object.
If bootstrapping confidence intervals were requested, this method has the option to print p-values computed by the method presented in Asparouhov and Muthén (2021). Note that these p-values are asymmetric bootstrap p-values based on the distribution of the bootstrap estimates. They not computed based on the distribution under the null hypothesis.
For a p-value of a, it means that a 100(1 - a)% bootstrapping confidence interval will have one of its limits equal to 0. A confidence interval with a higher confidence level will include zero, while a confidence interval with a lower confidence level will exclude zero.
If these conditions are met, the stored standard errors, if available, will be used test an effect and form it confidence interval:
Confidence intervals have not been formed (e.g., by bootstrapping or Monte Carlo).
The path has no mediators.
The model has only one group.
The path is moderated by one or more moderator.
Both the x
-variable and the
y
-variable are not standardized.
If the model is fitted by OLS
regression (e.g., using stats::lm()
),
then the variance-covariance matrix
of the coefficient estimates will be
used, and the p-value and confidence
intervals are computed from the t
statistic.
If the model is fitted by structural
equation modeling using lavaan
, then
the variance-covariance computed by
lavaan
will be used, and the p-value
and confidence intervals are computed
from the z statistic.
If the model is fitted by structural equation modeling and has moderators, the standard errors, p-values, and confidence interval computed from the variance-covariance matrices for conditional effects can only be trusted if all covariances involving the product terms are free. If any of them are fixed, for example, fixed to zero, it is possible that the model is not invariant to linear transformation of the variables.
x
is returned invisibly.
Called for its side effect.
Asparouhov, A., & Muthén, B. (2021). Bootstrap p-value computation. Retrieved from https://www.statmodel.com/download/FAQ-Bootstrap%20-%20Pvalue.pdf
cond_indirect_effects()
library(lavaan)
dat <- modmed_x1m3w4y1
mod <-
"
m1 ~ a1 * x + d1 * w1 + e1 * x:w1
m2 ~ a2 * x
y ~ b1 * m1 + b2 * m2 + cp * x
"
fit <- sem(mod, dat,
meanstructure = TRUE, fixed.x = FALSE, se = "none", baseline = FALSE)
# Conditional effects from x to m1 when w1 is equal to each of the default levels
cond_indirect_effects(x = "x", y = "m1",
wlevels = "w1", fit = fit)
# Conditional Indirect effect from x1 through m1 to y,
# when w1 is equal to each of the default levels
out <- cond_indirect_effects(x = "x", y = "y", m = "m1",
wlevels = "w1", fit = fit)
out
print(out, digits = 5)
print(out, annotation = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.