# NOT RUN {
mod <- lm_imp(y ~ C1 + C2 + M2, data = wideDF, n.iter = 100)
# densplot without vertical lines
densplot(mod)
# use vlines to mark zero
densplot(mod, col = c("darkred", "darkblue", "darkgreen"),
vlines = list(list(v = rep(0, nrow(summary(mod)$stats)),
col = grey(0.8))))
# use vlines to visualize the posterior mean and 2.5% and 97.5% quantiles
densplot(mod, vlines = list(list(v = summary(mod)$stats[, "Mean"], lty = 1, lwd = 2),
list(v = summary(mod)$stats[, "2.5%"], lty = 2),
list(v = summary(mod)$stats[, "97.5%"], lty = 2)))
# }
Run the code above in your browser using DataLab