# NOT RUN {
data("BSG2014")
# run fast and robust bootstrap test
robust_boot <- test_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict",
robust = TRUE)
# create dot plot for robust bootstrap test
plot_mediation(robust_boot, method = "dot")
# equivalently
dot <- fortify(robust_boot, method = "dot")
plot_mediation(dot)
# create density plot for robust bootstrap test
plot_mediation(robust_boot, method = "density")
# equivalently
density <- fortify(robust_boot, method = "density")
plot_mediation(density)
# run standard bootstrap test
standard_boot <- test_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict",
robust = FALSE)
# compare robust and standard tests
tests <- list(Standard = standard_boot, Robust = robust_boot)
plot_mediation(tests, method = "dot")
plot_mediation(tests, method = "density")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab