data("BSG2014")
# run fast-and-robust bootstrap test
robust_boot <- test_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict",
level = 0.9,
robust = TRUE)
# create plot for robust bootstrap test
ci_plot(robust_boot)
ci_plot(robust_boot, color = "#00BFC4")
# run OLS bootstrap test
ols_boot <- test_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict",
level = 0.9,
robust = FALSE)
# compare robust and OLS bootstrap tests
boot_list <- list("OLS bootstrap" = ols_boot,
"ROBMED" = robust_boot)
ci_plot(boot_list)
# the plot can be customized in the usual way
ci_plot(boot_list) +
geom_hline(yintercept = 0, color = "darkgrey") +
coord_flip() + theme_bw() +
labs(title = "OLS bootstrap vs ROBMED")
Run the code above in your browser using DataLab