add_index.simple_mediation {JSmediation}R Documentation

add_index method for simple mediation

Description

Adds confidence interval for the index of mediation to a model fitted with mdt_simple.

Usage

## S3 method for class 'simple_mediation'
add_index(mediation_model, times = 5000, level = 0.05, ...)

Arguments

mediation_model

A mediation model of class "simple_mediation".

times

Number of simulations to use to compute the Monte Carlo indirect effect confidence interval.

level

Alpha threshold to use for the confidence interval.

...

Further arguments passed to or from other methods.

Details

Indirect effect index for simple mediation uses a and b estimates and their standard errors to compute the ab product distribution using Monte Carlo methods (see MacKinnon, Lockwood, & Williams, 2004).

References

MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence Limits for the Indirect Effect: Distribution of the Product and Resampling Methods. Multivariate Behavioral Research, 39(1), 99-128. doi: 10.1207/s15327906mbr3901_4

Examples

## getting an indirect effect index
ho_et_al$condition_c <- build_contrast(ho_et_al$condition,
                                       "Low discrimination",
                                       "High discrimination")
simple_model <- mdt_simple(data = ho_et_al,
                           IV = condition_c,
                           DV = hypodescent,
                           M = linkedfate)
add_index(simple_model)


[Package JSmediation version 0.2.2 Index]