Skip to contents

Main Functions

Compute conditional indirect effects, conditional effects, and indirect effects.

cond_indirect() cond_indirect_effects() indirect_effect() many_indirect_effects()
Conditional, Indirect, and Conditional Indirect Effects
all_indirect_paths() all_paths_to_df()
Enumerate All Indirect Effects in a Model
indirect_effects_from_list()
Coefficient Table of an 'indirect_list' Class Object
total_indirect_effect()
Total Indirect Effect Between Two Variables

Presenting and Exploring the Effects

index_of_mome() index_of_momome()
Index of Moderated Mediation and Index of Moderated Moderated Mediation
cond_indirect_diff()
Differences In Conditional Indirect Effects
plot(<cond_indirect_effects>)
Plot Conditional Effects
indirect_proportion()
Proportion of Effect Mediated
delta_med()
Delta_Med by Liu, Yuan, and Li (2023)

Moderator Levels

Set the levels of moderators to be used in cond_indirect_effects() and cond_indirect().

mod_levels() mod_levels_list()
Create Levels of Moderators
merge_mod_levels()
Merge the Generated Levels of Moderators

Bootstrapping

Generate bootstrap estimates to be used by the main functions to form bootstrap confidence intervals

do_boot()
Bootstrap Estimates for 'indirect_effects' and 'cond_indirect_effects'
lm2boot_out() lm2boot_out_parallel()
Bootstrap Estimates for lm Outputs
fit2boot_out() fit2boot_out_do_boot()
Bootstrap Estimates for a lavaan Output

Monte Carlo

Generate simulated estimates to be used by the main functions to form Monte Carlo confidence intervals

do_mc() gen_mc_est()
Monte Carlo Estimates for 'indirect_effects' and 'cond_indirect_effects'
fit2mc_out()
Monte Carlo Estimates for a lavaan Output

For ‘lavaan’

factor2var()
Create Dummy Variables

For ‘lm’

lm2list()
Join 'lm()' Output to Form an 'lm_list`-Class Object

Methods

Methods and utility functions for the output of the main functions.

coef(<indirect>)
Extract the Indirect Effect or Conditional Indirect Effect
confint(<indirect>)
Confidence Interval of Indirect Effect or Conditional Indirect Effect
print(<indirect>)
Print an 'indirect' Class Object
`+`(<indirect>) `-`(<indirect>)
Math Operators for 'indirect'-Class Objects
coef(<indirect_list>)
Extract the Indirect Effects from a 'indirect_list' Object
confint(<indirect_list>)
Confidence Intervals of Indirect Effects in an 'indirect_list' Object
print(<indirect_list>)
Print an 'indirect_list' Class Object
coef(<cond_indirect_effects>)
Estimates of Conditional Indirect Effects or Conditional Effects
confint(<cond_indirect_effects>)
Confidence Intervals of Indirect Effects or Conditional Indirect Effects
print(<cond_indirect_effects>)
Print a 'cond_indirect_effects' Class Object
`[`(<cond_indirect_effects>)
Extraction Methods for 'cond_indirect_effects' Outputs
get_one_cond_indirect_effect() get_one_cond_effect()
Get The Conditional Indirect Effect for One Row of 'cond_indirect_effects' Output
coef(<cond_indirect_diff>)
Print the Output of 'cond_indirect_diff()'
confint(<cond_indirect_diff>)
Confidence Interval of the Output of 'cond_indirect_diff()'
print(<cond_indirect_diff>)
Print the Output of 'cond_indirect_diff'
print(<lm_list>)
Print an lm_list-Class Object
summary(<lm_list>) print(<summary_lm_list>)
Summary of an lm_list-Class Object
`[`(<wlevels>) `[<-`(<wlevels>) `[[<-`(<wlevels>)
Extraction Methods for a 'wlevels'-class Object
print(<all_paths>)
Print 'all_paths' Class Object
print(<boot_out>)
Print a boot_out-Class Object
print(<mc_out>)
Print a mc_out-Class Object
print(<indirect_proportion>)
Print an 'indirect_proportion'-Class Object
coef(<indirect_proportion>)
Extract the Proportion of Effect Mediated
print(<delta_med>)
Print a 'delta_med' Class Object
coef(<delta_med>)
Delta_Med in a 'delta_med'-Class Object
confint(<delta_med>)
Confidence Interval for Delta_Med in a 'delta_med'-Class Object

Advanced helpers

Helper functions exported for advanced users.

indirect_i()
Indirect Effect (No Bootstrapping)
check_path()
Check a Path Exists in a Model
lm_from_lavaan_list()
'lavaan'-class to 'lm_from_lavaan_list'-Class
coef(<lm_from_lavaan>)
Coefficients of an 'lm_from_lavaan'-Class Object
terms(<lm_from_lavaan>)
Model Terms of an 'lm_from_lavaan'-Class Object
predict(<lm_from_lavaan>)
Predicted Values of a 'lm_from_lavaan'-Class Object
predict(<lm_from_lavaan_list>)
Predicted Values of an 'lm_from_lavaan_list'-Class Object
predict(<lm_list>)
Predicted Values of an 'lm_list'-Class Object
get_prod()
Product Terms (if Any) Along a Path

Datasets

Datasets used in examples.

data_med
Sample Dataset: Simple Mediation
data_med_complicated
Sample Dataset: A Complicated Mediation Model
data_med_mod_a
Sample Dataset: Simple Mediation with a-Path Moderated
data_med_mod_ab
Sample Dataset: Simple Mediation with Both Paths Moderated (Two Moderators)
data_med_mod_ab1
Sample Dataset: Simple Mediation with Both Paths Moderated By a Moderator
data_med_mod_b
Sample Dataset: Simple Mediation with b-Path Moderated
data_med_mod_b_mod
Sample Dataset: A Simple Mediation Model with b-Path Moderated-Moderation
data_med_mod_parallel
Sample Dataset: Parallel Mediation with Two Moderators
data_med_mod_parallel_cat
Sample Dataset: Parallel Moderated Mediation with Two Categorical Moderators
data_med_mod_serial
Sample Dataset: Serial Mediation with Two Moderators
data_med_mod_serial_cat
Sample Dataset: Serial Moderated Mediation with Two Categorical Moderators
data_med_mod_serial_parallel
Sample Dataset: Serial-Parallel Mediation with Two Moderators
data_med_mod_serial_parallel_cat
Sample Dataset: Serial-Parallel Moderated Mediation with Two Categorical Moderators
data_mod
Sample Dataset: One Moderator
data_mod2
Sample Dataset: Two Moderators
data_mod_cat
Sample Dataset: Moderation with One Categorical Moderator
data_mome_demo
Sample Dataset: A Complicated Moderated-Mediation Model
data_mome_demo_missing
Sample Dataset: A Complicated Moderated-Mediation Model With Missing Data
data_parallel
Sample Dataset: Parallel Mediation
data_sem
Sample Dataset: A Latent Variable Mediation Model With 4 Factors
data_serial
Sample Dataset: Serial Mediation
data_serial_parallel
Sample Dataset: Serial-Parallel Mediation
data_serial_parallel_latent
Sample Dataset: A Latent Mediation Model With Three Mediators
modmed_x1m3w4y1
Sample Dataset: Moderated Serial Mediation
simple_mediation_latent
Sample Dataset: A Simple Latent Mediation Model