Description Usage Arguments Value Examples
View source: R/make_jagscode.R
Make JAGS Model Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | make_jagscode(
yi,
vi,
sei,
es_id,
study_id,
mods = ~1,
mods_scale2 = ~1,
mods_scale3 = ~1,
prior = NULL,
iter = 5000,
warmup = 1000,
chains = 4,
log_linear = TRUE,
data
)
|
yi |
vector with the observed effect sizes (length |
vi |
vector with the sampling variances (length |
sei |
vector with the sampling variances (length |
es_id |
numeric vector with the effect size ids (i.e., |
study_id |
numeric vector with the study ids (length |
mods |
an object of class |
mods_scale2 |
an object of class |
mods_scale3 |
an object of class |
prior |
one or more |
iter |
numeric. The number of posterior samples per chain
(defaults to |
warmup |
numeric. The number of warmup samples, which are discarded
(defaults to |
chains |
numeric. The number of chains (defaults to |
log_linear |
logical. Should the variance components be modeled on
the log-scale (defaults to |
data |
data frame containing the variables in the model. |
A character string with the model code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(psymetadata)
prior <-
c(assign_prior(param = "(Intercept)",
prior = "dnorm(0, 1)", dpar = "location"),
assign_prior(param = "(Intercept)",
prior = "dnorm(0, 10)",
dpar = "scale", level = "two")
)
make_jagscode(yi = yi,
vi = vi,
prior = prior,
es_id = es_id,
study_id = study_id,
data = gnambs2020)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.