Generates posterior draws of the response for a bayesnechurdlefit

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

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.

Details

For which = "combined" this simulates from the two-part process itself rather than summarising a mean curve: a survival outcome is drawn for each posterior draw and predictor value, and individuals that do not survive contribute an exact zero. The result therefore has the spike at zero that the observed data have, which the mean curve does not.