Extract posterior draws of the linear predictor for a ubmsFit submodel, possibly transformed by the inverse-link function.

# S4 method for class 'ubmsFit'
posterior_linpred(
  object,
  transform = FALSE,
  submodel,
  newdata = NULL,
  draws = NULL,
  re.form = NULL,
  ...
)

Arguments

object

A fitted model of class ubmsFit

transform

Should the linear predictor be transformed using the inverse link function?

submodel

The name of the submodel, as a character string, for which to calculate the linear predictor

newdata

Optional data frame of newdata to use when calculating the linear predictor. If not provided, the model matrix is used.

draws

An integer indicating the number of draws to return. The default and maximum number of draws is the size of the posterior sample.

re.form

If NULL, any estimated group-level parameters ("random effects") are included. If NA, they are ignored

...

Currently ignored

Value

A matrix of simulations from the posterior predictive distribution of the linear predictor. The dimensions are draws by number of linear predictor values (e.g., number of sites or number of observations).