# make_standata

0th

Percentile

##### Data for brms Models

Generate data for brms models to be passed to Stan

##### Usage
make_standata(formula, data, family = gaussian(), prior = NULL,
autocor = NULL, nonlinear = NULL, cov_ranef = NULL,
sample_prior = c("no", "yes", "only"), knots = NULL, control = list(),
...)
##### Arguments
formula

An object of class formula or brmsformula (or one that can be coerced to that classes): A symbolic description of the model to be fitted. The details of model specification are explained in brmsformula.

data

An object of class data.frame (or one that can be coerced to that class) containing data of all variables used in the model.

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 link argument allowing to specify the link function to be applied on the response variable. If not specified, default links are used. For details of supported families see brmsfamily. By default, a linear gaussian model is applied.

prior

One or more brmsprior objects created by set_prior or related functions and combined using the c method. A single brmsprior object may be passed without c() surrounding it. See also get_prior for more help.

autocor

An optional cor_brms object describing the correlation structure within the response variable (i.e., the 'autocorrelation'). See the documentation of cor_brms for a description of the available correlation structures. Defaults to NULL, corresponding to no correlations.

nonlinear

(Deprecated) An optional list of formulas, specifying linear models for non-linear parameters. If NULL (the default) formula is treated as an ordinary formula. If not NULL, formula is treated as a non-linear model and nonlinear should contain a formula for each non-linear parameter, which has the parameter on the left hand side and its linear predictor on the right hand side. Alternatively, it can be a single formula with all non-linear parameters on the left hand side (separated by a +) and a common linear predictor on the right hand side. As of brms 1.4.0, we recommend specifying non-linear parameters directly within formula.

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 data that are used as grouping factors. All levels of the grouping factor should appear as rownames of the corresponding matrix. This argument can be used, among others to model pedigrees and phylogenetic effects. See vignette("brms_phylogenetics") for more details.

sample_prior

Indicate if samples from all specified proper priors should be drawn additionally to the posterior samples (defaults to "no"). Among others, these samples can be used to calculate Bayes factors for point hypotheses. If set to "only", samples are drawn solely from the priors ignoring the likelihood. In this case, all parameters must have proper priors.

knots

Optional list containing user specified knot values to be used for basis construction of smoothing terms. See gamm for more details.

control

A named list currently for internal usage only

...

Other potential arguments

##### Value

A named list of objects containing the required data to fit a brms model with Stan.

##### Aliases
• make_standata
• brmdata
##### Examples
# NOT RUN {
data1 <- make_standata(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "cumulative")
names(data1)

data2 <- make_standata(count ~ log_Age_c + log_Base4_c * Trt_c
+ (1|patient) + (1|visit),
data = epilepsy, family = "poisson")
names(data2)

# }

Documentation reproduced from package brms, version 1.10.2, License: GPL (>= 3)

### Community examples

Looks like there are no examples yet.