Learn R Programming

manymome (version 0.2.7)

print.indirect_proportion: Print an 'indirect_proportion'-Class Object

Description

Print the content of an 'indirect_proportion'-class object, the output of indirect_proportion().

Usage

# S3 method for indirect_proportion
print(x, digits = 3, annotation = TRUE, ...)

Value

x is returned invisibly. Called for its side effect.

Arguments

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 TRUE.

...

Optional arguments. Not used.

Details

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.

See Also

indirect_proportion()

Examples

Run this code

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)


Run the code above in your browser using DataLab