Learn R Programming

brms (version 2.15.0)

emmeans-brms-helpers: Support Functions for emmeans

Description

Functions required for compatibility of brms with emmeans. Users are not required to call these functions themselves. Instead, they will be called automatically by the emmeans function of the emmeans package.

Usage

recover_data.brmsfit(object, data, resp = NULL, dpar = NULL, nlpar = NULL, ...)

emm_basis.brmsfit( object, trms, xlev, grid, vcov., resp = NULL, dpar = NULL, nlpar = NULL, ... )

Arguments

object

An object of class brmsfit.

data, trms, xlev, grid, vcov.

Arguments required by emmeans.

resp

Optional names of response variables. If specified, predictions are performed only for the specified response variables.

dpar

Optional name of a predicted distributional parameter. If specified, expected predictions of this parameters are returned.

nlpar

Optional name of a predicted non-linear parameter. If specified, expected predictions of this parameters are returned.

...

Additional arguments passed to emmeans.

Details

In addition to the usual choices for dpar, the special value dpar = "mean" requests that we use the expected values of the posterior predictive distribution, obtained via posterior_epred.brmsfit.

Examples

Run this code
# NOT RUN {
fit <- brm(time | cens(censored) ~ age * sex + disease + (1|patient),
            data = kidney, family = lognormal())
summary(fit)           

# summarize via 'emmeans'
library(emmeans)
rg <- ref_grid(fit)
em <- emmeans(rg, "disease")
summary(em, point.est = mean)

epred <- emmeans(fit, "disease", dpar = "mean")
summary(epred, point.est = mean)
# }

Run the code above in your browser using DataLab