bayesnechurdlefitR/bayesnechurdlefit-methods.R
posterior_predict.bayesnechurdlefit.RdGenerates 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,
...
)An object of class bayesnechurdlefit.
Which curve to return: "combined" (the default),
"growth" or "survival".
The number of unique predictor values to predict over.
A range of predictor values to predict over.
An optional data.frame of predictor
values. When supplied, resolution and x_range are ignored.
Optional group-effects setting passed to both components.
Passed to each component posterior method, including
ndraws and draw_ids.
A matrix.
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.