ComputeEffectsLinear: Computes direct and indirect effects for linear models.

View source: R/compute_effects.R

ComputeEffectsLinearR Documentation

Computes direct and indirect effects for linear models.

Description

ComputeEffectsLinear computes the direct and indirect effects for linear models. These are simple functions of the path coefficients. Argument can be path coefficients fitted to data, in format output by ComputePath or simulation parameters output by function such as SimpleSim.

Usage

ComputeEffectsLinear(fit)

Arguments

fit

List with path coefficients.

Value

Matrix of direct, indirect, and total effects for each xx.

Examples

set.seed(1234)
params <- SimpleSim()
dat <- SimulateData(params)
fit <- ComputePath(dat)
ComputeEffectsLinear(params) ## exact
ComputeEffectsLinear(fit) ## based on sample

longjp/mediateR documentation built on May 24, 2023, 12:30 p.m.