This function generates simulated data (\(y_{rep}\)) from the posterior distribution
of a fitted because model. These draws are used for posterior predictive checks (PPC)
and model validation.
Usage
# S3 method for class 'because'
posterior_predict(object, resp = NULL, ndraws = NULL, ...)
Arguments
- object
A because fit object.
- resp
Character string; the name of the response variable to predict.
If NULL, takes the first response variable in the model.
- ndraws
Integer; number of posterior draws to use. Defaults to all draws.
- ...
Additional arguments (currently ignored).
Value
A matrix of dimensions [ndraws x N_obs] containing simulated response values.