med_simple_lav_lat: Standardized Simple Mediation Model (lavaan)

Description Usage Arguments Author(s) Examples

View source: R/med.R

Description

Standardized Simple Mediation Model (lavaan)

Usage

1
med_simple_lav_lat(data, minimal = TRUE, est = FALSE, ...)

Arguments

data

A matrix with variables X, M, and Y.

minimal

Logical. If TRUE, returns the indirect effect of X on Y through M. If FALSE, returns all the regression coefficients estimated.

est

Logical. If TRUE, returns a vector of parameter estimates and standard errors. If FALSE, returns the lavaan object.

...

Arguments to pass to lavaan::sem.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Sigma <- matrix(
  data = c(
    225, 112.50, 56.25,
    112.5, 225, 112.5,
    56.25, 112.50, 225
  ),
  ncol = 3
)
mu <- c(100, 100, 100)
data <- gendat_mvn(
  n = 100,
  Sigma = Sigma,
  mu = mu
)
med_simple_lav_lat(data = data, minimal = FALSE)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.