simulKappa | R Documentation |
The function generates simulation data according to given categories and probabilities.
and can repeatedly apply function kappam_gold()
.
Currently, there is no variation in probabilities from rater to rater,
only sampling variability from multinomial distribution is at work.
simulKappa(nRater, cats, nSubj, probs, mcSim = 10, simOnly = FALSE)
nRater |
numeric. number of raters. |
cats |
categories specified either as character vector or just the numbers of categories. |
nSubj |
numeric. number of subjects per gold standard category. Either a single number or as vector of numbers per category, e.g. for non-balanced situation. |
probs |
numeric square matrix (nCat x nCat) with classification
probabilities. Row |
mcSim |
numeric. Number of Monte-Carlo simulations. |
simOnly |
logical. Need only simulation data? Default is |
This function is future-aware for the repeated evaluation of kappam_gold()
that is triggered by this function.
dataframe of kappa-gold on the simulated datasets or (when
simOnly=TRUE
) list of length mcSim
with each element a simulated data
set with goldrating in first column and then the raters.
# repeatedly estimate agreement with goldstandard for simulated data
simulKappa(nRater = 8, cats = 3, nSubj = 11,
# assumed prob for classification by raters
probs = matrix(c(.6, .2, .1, # subjects of cat 1
.3, .4, .3, # subjects of cat 2
.1, .4, .5 # subjects of cat 3
), nrow = 3, byrow = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.