View source: R/indirect_proportion.R
print.indirect_proportion | R Documentation |
Print the content of an
'indirect_proportion'-class object,
the output of indirect_proportion()
.
## S3 method for class 'indirect_proportion'
print(x, digits = 3, annotation = TRUE, ...)
x |
An 'indirect_proportion'-class object. |
digits |
Number of digits to display. Default is 3. |
annotation |
Logical. Whether
additional information should be
printed. Default is |
... |
Optional arguments. Not used. |
The print
method of the
indirect_proportion
-class object,
which is produced by
indirect_proportion()
. In addition
to the proportion of effect
mediated, it also prints additional
information such as the path for
which the proportion is computed,
and all indirect path(s) from the
x-variable to the y-variable.
To get the proportion as a scalar,
use the coef
method of
indirect_proportion
objects.
x
is returned invisibly. Called for
its side effect.
indirect_proportion()
library(lavaan)
dat <- data_med
head(dat)
mod <-
"
m ~ x + c1 + c2
y ~ m + x + c1 + c2
"
fit <- sem(mod, dat, fixed.x = FALSE)
out <- indirect_proportion(x = "x",
y = "y",
m = "m",
fit = fit)
out
print(out, digits = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.