View source: R/mediation.effect.plot.R
mediation.effect.plot  R Documentation 
Create a mediation effect plot
mediation.effect.plot(x, mediator, dv, ylab = "Dependent Variable", xlab = "Mediator", main = "Mediation Effect Plot", pct.from.top.a = 0.05, pct.from.left.c = 0.05, arrow.length.a = 0.05, arrow.length.c = 0.05, legend.loc = "topleft", file = "", pch = 20, xlim = NULL, ylim = NULL, save.pdf = FALSE, save.eps = FALSE, save.jpg = FALSE, ...)
x 
vector of the predictor/independent variable 
mediator 
vector of the mediator variable 
dv 
vector of the dependent/outcome variable 
ylab 
yaxis title label 
xlab 
xaxis title label 
main 
main title label 
pct.from.top.a 
figure fine tuning adjustment 
pct.from.left.c 
figure fine tuning adjustment 
arrow.length.a 
figure fine tuning adjustment 
arrow.length.c 
figure fine tuning adjustment 
legend.loc 
specify the location of the legend 
file 
file name of the plot to be saved (not necessary) 
pch 
plotting character 
xlim 
limits for the xaxis 
ylim 
limits for the yaxis 
save.pdf 

save.eps 

save.jpg 

... 
to incorporate options from interval functions 
Merrill (1994; see also MacKinnon, 2008; MacKinnon et al., 2007; Sy, 2004) presents a method that involves plotting the indirect effect as the vertical distance between two lines. Fritz and MacKinnon (2008) present a detailed exposition of this method too. Preacher and Kelley (2011) discuss this plotting method and implement their own code, which was also independently done as part of Fritz and MacKinnon (2008).
In this type of plot, the two horizontal lines correspond to the predicted values of Y regressed on X at the mean of X and at one unit above the mean of X. The distance between these two lines is thus \hat{c}. The two vertical lines correspond to predicted values of M regressed on X at the same two values of X. The distance between these lines is \hat{a}. The lines corresponding to the regression of Y on M (controlling for X) are plotted for the same two values of X.
A figure is returned.
Requires raw data.
Ken Kelley (University of Notre Dame; KKelley@nd.edu)
Fritz, M. S., & MacKinnon, D. P. (2008). A graphical representation of the mediated effect. Behavior Research Methods, 40, 55–60.
MacKinnon, D. P. (2008). Introduction to statistical mediation analysis. Mahwah, NJ: Erlbaum.
MacKinnon, D. P., Fairchild, A. J., & Fritz, M. S. (2007). Mediation analysis. Annual Review of Psychology, 58, 593–614.
Merrill, R. M. (1994). Treatment effect evaluation in nonadditive mediation models. Unpublished dissertation, Arizona State University.
Preacher, K. J., & Kelley, K. (2011). Effect size measures for mediation models: Quantitative and graphical strategies for communicating indirect effects. Psychological Methods, 16, 93–115.
Sy, O. S. (2004). Multilevel mediation analysis: Estimation and applications. Unpublished dissertation, Kansas State University.
mediation.effect.plot
, mediation.effect.bar.plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.