View source: R/summarize_preds.R
summarize_preds | R Documentation |
Summarize model predictions
summarize_preds(x, y_var = lead, retrans = TRUE, pred_var = ".epred", ...)
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 |
A dataframe containing the summarized predictions.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.