View source: R/add_pred_draws_car1.R
add_pred_draws_car1 | R Documentation |
Generate predictions for CAR(1) model
add_pred_draws_car1(
input,
object,
type = "epred",
car1 = TRUE,
draw_ids = NULL,
...
)
input |
A dataframe for which to generate model predictions. |
object |
A |
type |
For |
car1 |
Logical. Add CAR(1) errors? |
draw_ids |
Draw IDs from model object. If NULL (the default), all draws are used. |
... |
Argument 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_pred_draws_car1(data, fit, car1 = FALSE, draw_ids = 1234)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.