View source: R/add_resid_draws_car1.R
add_resid_draws_car1 | R Documentation |
brms
model objectGenerate residual draws from a brms
model object
add_resid_draws_car1(input, object, yvar, ...)
input |
A dataframe for which to generate model predictions/residuals. |
object |
A |
yvar |
Name of the response variable used to generate residuals. |
... |
Arguments passed on to |
A dataframe of the type generated by tidybayes::add_epred_draws()
.
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
)
add_resid_draws_car1(data, fit, yvar = y, car1 = FALSE, draw_ids = 1234)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.