rater | R Documentation |
This functions allows the user to fit statistical models of noisy categorical rating, based on the Dawid-Skene model, using Bayesian inference. A variety of data formats and models are supported. Inference is done using Stan, allowing models to be fit efficiently, using both optimisation and Markov Chain Monte Carlo (MCMC).
rater(
data,
model,
method = "mcmc",
data_format = "long",
long_data_colnames = c(item = "item", rater = "rater", rating = "rating"),
inits = NULL,
verbose = TRUE,
...
)
data |
A 2D data object: data.frame, matrix, tibble etc. with data in either long or grouped format. |
model |
Model to fit to data - must be rater_model or a character string - the name of the model. If the character string is used, the prior parameters will be set to their default values. |
method |
A length 1 character vector, either |
data_format |
A length 1 character vector, |
long_data_colnames |
A 3-element named character vector that specifies
the names of the three required columns in the long data format. The vector
must have the required names:
* item: the name of the column containing the item indexes,
* rater: the name of the column containing the rater indexes,
* rating: the name of the column containing the ratings.
By default, the names of the columns are the same as the names of the
vector: |
inits |
The initialization points of the fitting algorithm |
verbose |
Should |
... |
Extra parameters which are passed to the Stan fitting interface. |
The default MCMC algorithm used by Stan is No U Turn Sampling (NUTS) and the default optimisation method is LGFGS. For MCMC 4 chains are run be default with 2000 iterations in total each.
An object of class rater_fit containing the fitted parameters.
rstan::sampling()
, rstan::optimizing()
# Fit a model using MCMC (the default).
mcmc_fit <- rater(anesthesia, "dawid_skene")
# Fit a model using optimisation.
optim_fit <- rater(anesthesia, dawid_skene(), method = "optim")
# Fit a model using passing data grouped data.
grouped_fit <- rater(caries, dawid_skene(), data_format = "grouped")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.