Learn R Programming

tidytreatment (version 0.3.2)

predicted_draws.stan4bartFit: Get prediction draws from posterior of stan4bart-package models

Description

Get prediction draws from posterior of stan4bart-package models

Usage

# S3 method for stan4bartFit
predicted_draws(
  object,
  newdata,
  ...,
  value = ".prediction",
  sample_new_levels = TRUE
)

Arguments

object

A stan4bartFit object.

newdata

Data frame to generate predictions from [optional].

...

Additional arguments passed to the underlying prediction method for the type of model given.

value

The name of the output column.

sample_new_levels

logical; if TRUE, levels out of the training sample will have random effects drawn from their posterior predictive distribution. If FALSE, their random effects will be fixed to 0.