standata.default | R Documentation |
Generate data for brms models to be passed to Stan.
## Default S3 method:
standata(
object,
data,
family = gaussian(),
prior = NULL,
autocor = NULL,
data2 = NULL,
cov_ranef = NULL,
sample_prior = "no",
stanvars = NULL,
threads = getOption("brms.threads", NULL),
knots = NULL,
drop_unused_levels = TRUE,
...
)
object |
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 |
(Deprecated) An optional |
data2 |
A named |
cov_ranef |
(Deprecated) 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 |
sample_prior |
Indicate if draws from priors should be drawn
additionally to the posterior draws. Options are |
stanvars |
An optional |
threads |
Number of threads to use in within-chain parallelization. For
more control over the threading process, |
knots |
Optional list containing user specified knot values to be used
for basis construction of smoothing terms. See
|
drop_unused_levels |
Should unused factors levels in the data be
dropped? Defaults to |
... |
Other arguments for internal use. |
A named list of objects containing the required data to fit a brms model with Stan.
sdata1 <- standata(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "cumulative")
str(sdata1)
sdata2 <- standata(count ~ zAge + zBase * Trt + (1|patient),
data = epilepsy, family = "poisson")
str(sdata2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.