Computes the indirect effect (and all paths) in a 4 variable system, assuming all paths estimated.

1 |

`data` |
data.frame containing the variables labeled 'x', 'm1', 'm2', and 'y' respectively. |

Computes the paths in the model system: /cr
Y = t'X + fM1 + cM2

M2 = eX + bM1

M1 = aX

and the indirect effect a*b*c + a*f + e*c

Returns a table with all the effects and decomposition of effects in the above 4 variable system inclucing the standard errors and t-values.

`a` |
Effect of X on M1 |

`b` |
Effect of M1 on M2 controlling for X |

`c` |
Effect of M2 on Y controlling for X and M1 |

`e` |
Effect of X on M2 controlling for M1 |

`f` |
Effect of M1 on Y controlling for X and M2 |

`abc` |
'Direct' Indirect Effect of X on Y |

`af` |
Indirect Effect of X on Y through M1 only |

`ef` |
Indirect Effect of M1 on Y though M2 |

`ind.xy` |
'Total' Indirect effect of X on Y |

`t` |
Total Effect of X on Y |

`t'` |
Direct Effect of X on Y accounting for all mediators |

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, m1, m2, and y.

This function uses the following undocumented functions: `se.indirect3`

Thomas D. Fletcher tom.fletcher.mp7e@statefarm.com

Fletcher, T. D. (2006, August). *Methods and approaches to assessing distal mediation.* Paper presented at the 66th annual meeting of the Academy of Management, Atlanta, GA.

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.

1 2 3 4 5 | ```
cormat <- matrix (c(1,.3,.15,.075,.3,1,.3,.15,.15,.3,1,.3,.075,.15,.3,1),ncol=4)
require(MASS)
d200 <- data.frame(mvrnorm(200, mu=c(0,0,0,0), cormat))
names(d200) <- c("x","m1","m2","y")
distal.med(d200)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.