Generates point predictions and confidence/ prediction intervals for new data.
Arguments
- model_result
A fitted result from any
reg_*()function.- n_new
Number of new observations to generate when
newdatais not supplied. Predictor values are drawn from the empirical distributions of the input columns (normal approximation by mean/sd for numeric columns; levels sampled with observed proportions for factor columns).- level
Confidence/interval level. Defaults to 0.95.
- newdata
Optional data frame of new predictor values. When supplied, predictions are made for exactly these rows and
n_newis ignored.
Value
A named list with:
- predictions
Tibble with predicted values.
- confidence_interval
Tibble with lower and upper bounds of the confidence interval.
- prediction_interval
Tibble with lower and upper bounds of the prediction interval (linear models only).
- newdata
The data frame actually used for prediction.