Learn R Programming

rater (version 1.3.2)

posterior_predict.rater_fit: Draw from the posterior predictive distribution

Description

Draw from the posterior predictive distribution

Usage

# S3 method for rater_fit
posterior_predict(object, new_data, seed = NULL, ...)

Value

The passed new_data augmented with a column 'z' containing the latent class of each item and 'rating' containing the simulated rating.

Arguments

object

A rater_fit object.

new_data

New data for the model to be fit to. The must be in the form used in rater() except without the 'rating' column.

seed

An optional random seed to use.

...

Other arguments.

Details

The number of raters implied by the entries in the rater column must match the number of raters in the fitted model.

Examples

Run this code

# \donttest{

fit <- rater(anesthesia, "dawid_skene", verbose = FALSE)
new_data <- data.frame(item = rep(1:2, each = 5), rater = rep(1:5, 2))

predictions <- posterior_predict(fit, new_data)
predictions

# }

Run the code above in your browser using DataLab