Description Usage Arguments Details Value Examples
This function is useful for visualizing the prior distributions.
1 | sample_prior(object, iter = 5000, ...)
|
object |
An object of class |
iter |
numeric. The number of posterior samples per chain
(defaults to |
... |
Currently ignored. |
Note that parameters include
beta
(location or effect size),
gamma
(level-two scale model),
and eta
(level-three scale model). Importantly,
the scale model priors are on the log-scale (use exp
).
A data frame including the posterior samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(psymetadata)
prior <- c(assign_prior(param = "(Intercept)",
prior = "dnorm(0, 1)", dpar = "location"),
assign_prior(param = "(Intercept)",
prior = "dnorm(-2, 1)",
dpar = "scale", level = "two")
)
priors <- make_prior(yi = yi,
vi = vi,
prior = prior,
es_id = es_id,
study_id = study_id,
data = gnambs2020)
samps <- sample_prior(priors, iter = 50000)
hist(samps$beta)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.