Draw from the posterior predictive distribution

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

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.

Value

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

Details

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

Examples


# \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 2       2
#> 2     1     2 2       4
#> 3     1     3 2       3
#> 4     1     4 2       2
#> 5     1     5 2       2
#> 6     2     1 1       1
#> 7     2     2 1       1
#> 8     2     3 1       1
#> 9     2     4 1       1
#> 10    2     5 1       1

# }