Skip to contents

In the multiple mediation model with mediators M_k = i_k + a_k X and outcome Y = i + cp X + sum b_k M_k, the specific indirect effect through mediator k is \(a_k b_k\) and the total indirect effect is \(\sum_k a_k b_k\), which equals c - c-prime (Preacher and Hayes 2008, pp. 880-881). Each a_k comes from the regression of M_k on X; the b_k and the direct effect come from one regression of Y on X and all mediators. Percentile intervals use the (B alpha/2)-th and (B (1 - alpha/2) + 1)-th order statistics of the B resampled estimates.

Usage

Prehay(x, M, y, B = 1000L, alpha = 0.05, seed = 1L)

Arguments

x

Independent variable, length n.

M

Mediator matrix, n rows, one column per mediator.

y

Outcome, length n.

B

Number of bootstrap resamples.

alpha

Two-sided miss probability.

seed

Seed for set.seed.

Value

List with estimate (total indirect), specific, a, b, c_prime, ci_lower, ci_upper, specific_lower, specific_upper, se, B, n, conf_level, method.

References

Preacher, K. J. and Hayes, A. F. (2008), Asymptotic and resampling strategies for assessing and comparing indirect effects in multiple mediator models, Behavior Research Methods 40(3), 879-891, doi:10.3758/BRM.40.3.879, pp. 880-884. Rank rule: Preacher and Hayes (2004), Behavior Research Methods, Instruments, and Computers 36(4), 717-731, p. 722.

Examples

Prehay(x = c(2.5, 1.0, 3.5, 4.0, 2.0, 5.5, 3.0, 6.5), M = c(1, 2, 3, 4, 5, 6, 7, 8),
  y = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 0.9130435
#> 
#> $specific
#> [1] 0.9130435
#> 
#> $a
#> [1] 0.9130435
#> 
#> $b
#> [1] 1
#> 
#> $c_prime
#> [1] 1.210143e-15
#> 
#> $ci_lower
#> [1] 0.1016949
#> 
#> $ci_upper
#> [1] 1.578947
#> 
#> $specific_lower
#> [1] 0.1016949
#> 
#> $specific_upper
#> [1] 1.578947
#> 
#> $se
#> [1] 0.3386402
#> 
#> $B
#> [1] 1000
#> 
#> $n
#> [1] 8
#> 
#> $conf_level
#> [1] 0.95
#> 
#> $method
#> [1] "Preacher-Hayes (2008) multiple-mediator percentile bootstrap"
#>