make_stancode(formula, data = NULL, family = gaussian(), prior = NULL,
autocor = NULL, nonlinear = NULL, partial = NULL,
threshold = c("flexible", "equidistant"), sparse = FALSE,
cov_ranef = NULL, sample_prior = FALSE, stan_funs = NULL,
save_model = NULL, ...)
as.data.frame
to a data frame) containing the variables in the model.
If not found in data, the variables are taken from environment(formula)
,
typically tgaussian
brmsprior
objects created by function
set_prior
and combined using the c
method.
A single brmsprior
object may be passed without
NULL
(the default)
formula
is treated as an ordinary formula.
If not NULL
, formula
is treated as a non-linear mo~expression
allowing to specify predictors with
category specific effects in non-cumulative ordinal models
(i.e. in families cratio
, sratio
, or acat
).
"flexible"
provides the standard unstructured thresholds and
"equidistant"
restricts the distance between
consecutive threshFALSE
).
For design matrices with many zeros, this can considerably
reduce required memory. For all models using multivariate syntax
(i.data
that are used as grouping factors.
All levels of the grouping factor sFALSE
). Among others, these samples can be used
to calculate Bayes factors for point hypotheses.
AlternatNULL
or a character string.
In the latter case, the model code is
saved in a file named after the string supplied in save_model
,
which may also contain the full path where to save the file.
If only a name is given, tmake_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")
Run the code above in your browser using DataLab