Generates posterior predictions for a bayesnechurdlefit

# S3 method for class 'bayesnechurdlefit'
posterior_epred(
  object,
  which = "combined",
  resolution = 1000,
  x_range = NA,
  newdata = NULL,
  re_formula = NULL,
  ...
)

Arguments

object

An object of class bayesnechurdlefit.

which

Which curve to return: "combined" (the default), "growth" or "survival".

resolution

The number of unique predictor values to predict over.

x_range

A range of predictor values to predict over.

newdata

An optional data.frame of predictor values. When supplied, resolution and x_range are ignored.

re_formula

Optional group-effects setting passed to both components.

...

Passed to each component posterior method, including ndraws and draw_ids.

Value

A matrix with draws as rows and predictor values as columns.

Details

The combined curve is the product of the growth curve and the probability of survival, i.e. the expected response per individual exposed. Draws are paired by row, which is valid because the two posteriors are independent – see bnec_hurdle. Without newdata, a group term spanning concentrations is predicted for its observed levels and mixed by their observation counts. A level observed at one concentration is excluded.