data("BSG2014")
# obtain robust fit of mediation model
fit <- fit_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict")
# create diagnostic plot of robust regression weights
weight_plot(fit) +
scale_color_manual("", values = c("black", "#00BFC4")) +
theme(legend.position = "top")
# plot only the regression model for the hypothesized mediator
weight_plot(fit, outcome = "TaskConflict") +
scale_color_manual("", values = c("black", "#00BFC4")) +
theme(legend.position = "top")
Run the code above in your browser using DataLab