mediation_summary {psycModel}R Documentation

Mediation Analysis

Description

[Experimental]
It currently only support simple mediation analysis using the path analysis approach with the lavaan package. I am trying to implement multilevel mediation in lavaan. In the future, I will try supporting moderated mediation (through lavaan or mediation) and mediation with latent variable (through lavaan).

Usage

mediation_summary(
  data,
  response_variable,
  mediator,
  predictor_variable,
  control_variable = NULL,
  group = NULL,
  standardize = TRUE,
  digits = 3,
  quite = FALSE,
  streamline = FALSE,
  return_result = FALSE
)

Arguments

data

data.frame

response_variable

response variable. Support dplyr::select() syntax.

mediator

mediator. Support dplyr::select() syntax.

predictor_variable

predictor variable. Support dplyr::select() syntax.

control_variable

control variables / covariate. Support dplyr::select() syntax.

group

nesting variable for multilevel mediation. Not confident about the implementation method. [Experimental]

standardize

standardized coefficients. Default is TRUE

digits

number of digits to round to

quite

suppress printing output

streamline

print streamlined output

return_result

If it is set to TRUE, it will return the lavaan object

Value

an object from lavaan

Examples

mediation_summary(
  data = lmerTest::carrots,
  response_variable = Preference,
  mediator = Sweetness,
  predictor_variable = Crisp
)

[Package psycModel version 0.5.0 Index]