mediation estimates the role of particular causal mechanisms that mediate a relationship between treatment and outcome variables. Calculates causal mediation effects and direct effects for models with continuous or binary dependent variables using methods presented in Imai et al 2010. Also calculates sensitivity analyses for mediation effects that are necessary due to non-random assignment of mediating variable. Package replaces earlier approaches like the "Baron-Kenny" method and "Sobel test" for the case of continuous mediator and outcome variables, producing identical results as these earlier methods but not put in a causal inference framework and with sensitivity analyses to the key identification assumption. For models with binary mediators or outcomes, correct calculation of mediation effects are implemented that take into account the use of non-linear models such as probit.