add_index.within_participant_mediation: add_index method for within-participant mediation

View source: R/mdt_within_index.R

add_index.within_participant_mediationR Documentation

add_index method for within-participant mediation

Description

Adds the confidence interval for the index of within-participant mediation to a model fitted with mdt_within or mdt_within_wide.

Usage

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

Arguments

mediation_model

A mediation model of class "within_participant_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 within-participant mediation uses a and b estimates and their standard error 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
within_model <- mdt_within(data = dohle_siegrist,
                           IV = name,
                           DV = willingness,
                           M = hazardousness,
                           grouping = participant)
add_index(within_model)


JSmediation documentation built on Feb. 16, 2023, 7:25 p.m.