ComputePath: Computes path coefficients.

View source: R/compute_effects.R

ComputePathR Documentation

Computes path coefficients.

Description

ComputePath computes the coefficients for for all paths linking response, mediators, treatment and potential confounders.

Usage

ComputePath(dat, reg = FALSE, mmn = FALSE)

Arguments

dat

List containing data (see SimulateData for format)

reg

Should path coefficient estimates be regularized. Experimental. Defaults to FALSE.

mmn

Should residuals from mm | xx regression be returned. If FALSE return NULL. Must be true if estimating direct/indirect effects with graph structure.

Value

List containing path coefficients, variance estimates, residuals.

Examples

params <- SimpleSim()
dat <- SimulateData(params)
fit <- ComputePath(dat)
print(fit$xx_direct)
print(params$xx_direct)

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