Learn R Programming

QuantPsyc (version 1.6)

proximal.med: Simple Mediation Models

Description

Computes the Indirect Effect for a simple 3 variable mediation model: X -> M -> Y assuming direct effect X -> Y

Usage

proximal.med(data)

Arguments

data

data.frame containing the variables labeled 'x', 'm', and 'y' respectively.

Value

Creates a table containing the following effects, their standard errors, and t-values :

a

Effect of X on M

b

Effect of M on Y controlling for X

t

Total effect of X on Y

t'

Direct effect of X on Y accounting for M

ab

Indirect effect of X on Y though M

Aroian

Standard error of ab using Aroian method

Goodman

Standard error of ab using Goodman method

Med.Ratio

Mediation Ratio: indirect effect / total effect

Warning

This function is primative in that it is based on a simplistic model AND forces the user to name the variables in the dataset x, m, and y.

Details

This function computes all paths in the simple 3 variable system involving the following regressions: Y = t'X + bM, and M = aX where t' + ab = t

The indirect effect is computed as the product of a*b. Several formula are used for the computation of the standard error for the indirect effect (see MacKinnon et al for a comprehensive review). As noted below, one can use this function to create the indirect effect and then utilize bootstrapping for a more accurate estimate of the standard error and model the distribution of the direct effect.

References

MacKinnon, D. P., Lockwood, C. M., Hoffman, J. M., West, S. G., & Sheets, V. (2002). A comparison of methods to test mediation and other intervening variable effects. Psychological Methods, 7, 83-104.

See Also

distal.med, proxInd.ef

Examples

Run this code
# NOT RUN {
data(tra)
tmp.tra <- tra
names(tmp.tra) <- c('x','z','m','y')
data.frame(proximal.med(tmp.tra))  ## data.frame() simple makes the table 'pretty'


# }

Run the code above in your browser using DataLab