# NOT RUN {
data("BSG2014")
# run fast and robust bootstrap test
robust_boot <- test_mediation(BSG2014,
                              x = "ValueDiversity",
                              y = "TeamCommitment",
                              m = "TaskConflict",
                              robust = TRUE)
# set up information for plot
setup <- setup_density_plot(robust_boot)
# plot only density and confidence interval
ggplot() +
  geom_density(aes(x = ab, y = Density), data = setup$density,
               stat = "identity") +
  geom_rect(aes(xmin = Lower, xmax = Upper,
                ymin = -Inf, ymax = Inf),
            data = setup$ci, color = NA, alpha = 0.2) +
  labs(x = "Indirect effect", y = "Bootstrap density")
# }
Run the code above in your browser using DataLab