| make_stancode {brms} | R Documentation |
Generate Stan code for brms models
make_stancode(formula, data, family = gaussian(), prior = NULL,
autocor = NULL, cov_ranef = NULL, sparse = FALSE,
sample_prior = c("no", "yes", "only"), stanvars = NULL,
stan_funs = NULL, save_model = NULL, silent = FALSE, ...)
formula |
An object of class |
data |
An object of class |
family |
A description of the response distribution and link function to
be used in the model. This can be a family function, a call to a family
function or a character string naming the family. Every family function has
a |
prior |
One or more |
autocor |
An optional |
cov_ranef |
A list of matrices that are proportional to the (within)
covariance structure of the group-level effects. The names of the matrices
should correspond to columns in |
sparse |
Logical; indicates whether the population-level design matrices
should be treated as sparse (defaults to |
sample_prior |
Indicate if samples from all specified proper priors
should be drawn additionally to the posterior samples (defaults to
|
stanvars |
An optional |
stan_funs |
(Deprecated) An optional character string containing
self-defined Stan functions, which will be included in the functions
block of the generated Stan code. It is now recommended to use the
|
save_model |
Either |
silent |
logical; If |
... |
Other arguments for internal usage only |
A character string containing the fully commented Stan code to fit a brms model.
make_stancode(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "cumulative")
make_stancode(count ~ log_Age_c + log_Base4_c * Trt_c
+ (1|patient) + (1|visit),
data = epilepsy, family = "poisson")