Learn R Programming

BayesMed (version 1.0.1)

plot.JZSMed: Display the results of jzs_med in a figure.

Description

This function displays the estimates and posterior probabilities of path alpha, beta, and tau' in a mediation schema and thus renders a clear view of the structure in the data.

Usage

"plot"(x,...)

Arguments

x
the output of the jzs_med function.
...
additional arguments to be passed on to the plot method, such as graphical parameters (see par).

See Also

jzs_med

Examples

Run this code
## 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)
# 
# # save jzs_med output
# res <- jzs_med(independent=X,dependent=Y,mediator=M)
# 
# # plot results
# plot(res$main_result)
# ## End(Not run)

Run the code above in your browser using DataLab