Skip to contents

One + method serves bf() and mvbf() objects alike, so a sum of any number of formulas reads left to right. The sum of bf(y1 ~ x), bf(y2 ~ x) and bf(y3 ~ x) is mvbf(bf(y1 ~ x), bf(y2 ~ x), bf(y3 ~ x)).

Usage

# S3 method for class 'frmtmb_bform'
e1 + e2

Arguments

e1

A bf() or mvbf() object.

e2

The object to add.

Value

A frmtmb_formula or a frmtmb_mvformula.

Details

The right-hand side can be another formula, a family, lf(), nlf() or set_rescor(). A family added to a single formula sets its family. A family added to a multivariate formula goes to every response that has no family yet, so in the sum of bf(o ~ x), cumulative(), bf(y ~ x) and gaussian() the response o stays ordinal. brms instead gives the last family to every response. An lf() or nlf() added to a multivariate formula names its response with resp =.

Examples

# three responses, one family for all of them
bf(y1 ~ x) + bf(y2 ~ x) + bf(y3 ~ x) + gaussian()
#> y1 ~ x
#> Family: gaussian 
#> y2 ~ x
#> Family: gaussian 
#> y3 ~ x
#> Family: gaussian 
#> rescor: FALSE 

# a family per response, and a dpar formula for the third response
bf(o ~ x) + cumulative() + bf(y1 ~ x) + gaussian() + bf(y2 ~ x) +
  lf(sigma ~ x, resp = "y2")
#> o ~ x
#> Family: cumulative 
#> y1 ~ x
#> Family: gaussian 
#> y2 ~ x
#> sigma ~ x
#> rescor: FALSE