summarize_preds: Summarize model predictions

View source: R/summarize_preds.R

summarize_predsR Documentation

Summarize model predictions

Description

Summarize model predictions

Usage

summarize_preds(x, y_var = lead, retrans = TRUE, pred_var = ".epred", ...)

Arguments

x

A dataframe of model predictions.

y_var

The untransformed response, used to backtransform predictions.

retrans

Logical. Backtransform predictions?

pred_var

The column name containing predictions to summarize.

...

Arguments passed on to retrans().

Value

A dataframe containing the summarized predictions.

Examples

library("brms")
seed <- 1
data <- read.csv(paste0(system.file("extdata", package = "bgamcar1"), "/data.csv"))
fit <- fit_stan_model(
   paste0(system.file("extdata", package = "bgamcar1"), "/test"),
   seed,
   bf(y | cens(ycens, y2 = y2) ~ 1),
   data,
   prior(normal(0, 1), class = Intercept),
   car1 = FALSE,
   save_warmup = FALSE,
   chains = 3
 )
preds <- add_pred_draws_car1(data, fit, car1 = FALSE, draw_ids = 1234)
summarize_preds(preds, y_var = y, log = FALSE)

bentrueman/bgamcar1 documentation built on July 6, 2024, 11:16 p.m.