Description Usage Arguments Author(s) References See Also Examples
Plot the posterior distribution of the indirect effect alpha*beta including a 95% credible interval around the mean of the posterior (see Nuijten et al. (2014); Yuan & MacKinnon, 2009).
1 2 |
x |
the posterior samples of alpha*beta as obtained from the output of |
... |
additional arguments to be passed on to the plot method, such as graphical parameters (see |
Michele B. Nuijten <m.b.nuijten@uvt.nl>, Ruud Wetzels, Dora Matzke, Conor V. Dolan, and Eric-Jan Wagenmakers.
Nuijten, M. B., Wetzels, R., Matzke, D., Dolan, C. V., & Wagenmakers, E.-J. (2014). A default Bayesian hypothesis test for mediation. Behavior Research Methods. doi: 10.3758/s13428-014-0470-2
Yuan, Y., & MacKinnon, D. (2009). Bayesian mediation analysis. Psychological Methods, 14, 301-322.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# simulate mediational data
a <- .5
b <- .6
t_prime <- .3
X <- rnorm(50,0,1)
M <- a*X + rnorm(50,0,1)
Y <- t_prime*X + b*M + rnorm(50,0,1)
# run jzs_med
res <- jzs_med(independent=X,dependent=Y,mediator=M)
# plot posterior distribution of a*b
plot(res$ab_samples)
# print the exact lower and upper boundary of the interval
res$CI_ab
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.