# for aurigular acupuncture (AA) data set with two
# actual half-normal and half-Cauchy heterogeneity priors
data(aa)
# it takes a few seconds to run each of the following functions
# prior densities
plot_RA(df=aa, tau.prior=list(function(t)dhalfnormal(t, scale=1),
function(t)dhalfcauchy(t, scale=1)),
type="pri.tau", xlim=c(0,2), ylim=c(0,3), legend=TRUE,
legend.tau.prior=c("HN(1)", "HC(1)"))
# marginal posterior for the effect mu
plot_RA(df=aa, tau.prior=list(function(t)dhalfnormal(t, scale=1),
function(t)dhalfcauchy(t, scale=1)),
type="post.mu", xlim=c(-1.5,2), ylim=c(0,3), legend=TRUE,
legend.tau.prior=c("HN(1)", "HC(1)"))
Run the code above in your browser using DataLab