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

View source: R/indirect_proportion.R

print.indirect_proportionR Documentation

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 class 'indirect_proportion'
print(x, digits = 3, annotation = TRUE, ...)

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.

Value

x is returned invisibly. Called for its side effect.

See Also

indirect_proportion()

Examples


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)



manymome documentation built on Oct. 4, 2024, 5:10 p.m.