Learn R Programming

brms (version 0.1.0)

brm.data: Extract required data for brms models

Description

Extract required data for brms models

Usage

brm.data(formula, data = NULL, family = c("gaussian", "identity"),
  prior = list(), partial = NULL, engine = "stan", ...)

Arguments

formula
An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under 'Details'.
data
An optional data frame, list or environment (or object coercible by 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 the e
family
A vector of one or two character strings. The first string indicates the distribution of the dependent variable (the 'family'). Currently, the following families are supported: "gaussian", "student", "cauchy",
prior
A named list of character strings specifing the prior distributions of the parameters. Further information is provided under 'Details'.
partial
A one sided formula of the form ~ partial.effects specifing the predictors that can vary between categories in non-cumulative ordinal models (i.e. in families "cratio", "sratio", or "acat").
engine
A character string, either "stan" (the default) or "jags". Specifies which program should be used to fit the model. Note that jags is currently implemented for testing purposes only, does not allow full functionalit
...
Further arguments for testing purposes only

Value

  • A named list of objects containing the required data to fit a brms model

Examples

Run this code
data1 <- brm.data(rating ~ treat + period + carry + (1|subject),
         data = inhaler, family = "cumulative")
names(data1)

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

Run the code above in your browser using DataLab