R/posterior_predict.R
posterior_predict.rater_fit.RdDraw from the posterior predictive distribution
# S3 method for class 'rater_fit'
posterior_predict(object, new_data, seed = NULL, ...)A rater_fit object.
New data for the model to be fit to. The must be in the form
used in rater() except without the 'rating' column.
An optional random seed to use.
Other arguments.
The passed new_data augmented with a column 'z' containing the
latent class of each item and 'rating' containing the simulated rating.
The number of raters implied by the entries in the rater column must match the number of raters in the fitted model.
# \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
#> item rater z ratings
#> 1 1 1 3 3
#> 2 1 2 3 3
#> 3 1 3 3 3
#> 4 1 4 3 3
#> 5 1 5 3 3
#> 6 2 1 2 2
#> 7 2 2 2 3
#> 8 2 3 2 1
#> 9 2 4 2 1
#> 10 2 5 2 3
# }