Robust mediation test

Description

Performs a robust mediation test according to the method proposed by Zu & Yuan (2010).

Usage

1
ZYmediate(x, y, med, nboot = 2000, alpha = 0.05, kappa = 0.05)

Arguments

x

vector with predictor values.

y

vector with response values.

med

vector with mediator values.

nboot

number of bootstrap samples.

alpha

alpha level.

kappa

the percent of cases to be controlled when robust method is used.

Value

ZYmediate returns an object of class "robmed" containing:

a.est

effect of predictor on mediator)

b.est

effect of mediator on response (in multiple regression model which includes the predictor as well)

ab.est

indirect effect (mediation effect)

CI.ab

confidence interval mediation effect

p.value

p-value mediation test

call

function call

References

Zu J., Yuan, K.-H. (2010). Local influence and robust procedures for mediation analysis. Multivariate Behavioral Research, 45, 1-44.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Leerkes data: 
## Y: Efficacy
## X: MatCare
## M: Esteem

## fitting robust mediator regressions
require(MASS)
summary(rlm(Efficacy ~ MatCare, data = Leerkes))
summary(rlm(Esteem ~ MatCare, data = Leerkes))
summary(rlm(Efficacy ~ MatCare + Esteem, data = Leerkes))

## robust testing of mediating effect (indirect effect)
with(Leerkes, ZYmediate(MatCare, Efficacy, Esteem))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.