Learn R Programming

rater

rater provides tools for fitting and interrogating statistical models of repeated categorical rating data. The package provides a simple interface to fit a selection of these models, with arbitrary prior parameters, using MCMC and optimisation provided by Stan. A selection of functions are also provided to plot parts of these models and extract key parameters.

Example usage:

library(rater)

fit <- rater(anesthesia, "dawid_skene") # Sampling output suppressed.

Get the posterior mean of the “pi” parameter.

point_estimate(fit, "pi")
## $pi
## [1] 0.37559632 0.40734481 0.14321934 0.07383953

Plot the accuracy matrices of the raters.

plot(fit, "raters")

Installation

rater requires the rstan package to fit models. Detailed instructions to install rstan can be found here

CRAN

Install rater from CRAN with:

install.packages("rater")

Development

To install the development version of rater from GitHub run:

# install.packages("remotes")
remotes::install_github("jeffreypullin/rater")

Installation notes:

  • When installing from source, i.e. when installing the development version or installing from CRAN on Linux, the Stan models in the package will be compiled - this will lead to an install time of few minutes. Please be patient - this compilation means that no compilation is required when using the package

  • During compilation many warnings may be displayed in the terminal; these are harmless but impossible to suppress.

Copy Link

Version

Install

install.packages('rater')

Monthly Downloads

370

Version

1.3.2

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Jeffrey Pullin

Last Published

July 23rd, 2025

Functions in rater (1.3.2)

waic.rater_fit

Compute the WAIC - a measure of model fit - of a rater fit object.
rater-package

The 'rater' package.
wide_to_long

Convert wide data to the long format
rater

Fit statistical models to repeated categorical rating data using Stan
summary.mcmc_fit

Summarise a mcmc_fit object
simulate_hier_dawid_skene_model

Simulate data from the hierarchical Dawid-Skene model
point_estimate

Extract point estimates of parameters from a fit object
reexports

Objects exported from other packages
simulate_dawid_skene_model

Simulate data from the Dawid-Skene model
summary.optim_fit

Summarise an optim_fit object
summary.rater_model

Summarise a rater_model.
make_complete_rating_design_sim_data

Produce simulation data from a 'complete' rating design
as_mcmc.list

Convert a rater_fit object to a coda mcmc.list object.
caries

Dentist ratings of whether caries are healthy or not based on X-rays
get_stanfit

Get the underlying stanfit object from a rater_fit object.
models

Probabilistic models of repeated categorical rating
make_theta

Make a theta parameter
mcmc_diagnostics

Retrieve MCMC convergence diagnostics for a rater fit
class_probabilities

Extract latent class probabilities from a rater fit object
loo.rater_fit

Compute the PSIS LOO CV - a measure of model fit - of a rater fit object.
posterior_samples

Extract posterior samples from a rater fit object
posterior_predict.rater_fit

Draw from the posterior predictive distribution
print.mcmc_fit

Print a mcmc_fit object
print.optim_fit

Print a optim_fit object
prior_summary.rater_fit

Provide a summary of the priors specified in a rater_fit object.
print.rater_model

Print a rater_model object.
plot.rater_fit

Plot a rater_fit object
anesthesia

Anaesthetist ratings for patient suitability for surgery
posterior_interval.mcmc_fit

Extract posterior intervals for parameters of the model
posterior_interval.optim_fit

Extract posterior intervals for parameters of the model