krippendorffs.alpha {krippendorffsalpha} | R Documentation |
Apply Krippendorff's Alpha.
Description
Apply Krippendorff's Alpha.
Usage
krippendorffs.alpha(
data,
level = c("interval", "nominal", "ordinal", "ratio"),
method = c("analytical", "customary"),
confint = TRUE,
verbose = FALSE,
control = list()
)
Arguments
data |
a matrix of scores. Each row corresponds to a unit, each column to a coder. |
level |
the level of measurement, one of |
method |
the methodology to apply, either |
confint |
logical; if |
verbose |
logical; if |
control |
a list of control parameters.
|
Details
This is the package's flagship function. It applies the Krippendorff's Alpha methodology for nominal, ordinal, interval, or ratio levels of measurement, and, if desired, produces confidence intervals. Parallel computing is supported, when applicable.
If the level of measurement is nominal, the discrete metric (nominal.dist
) is employed by default. If the level of measurement is interval or ordinal, the squared-difference distance function (interval.dist
) is employed by default. (For the ordinal level of measurement, using the squared-difference distance function may be inappropriate, in which case the user should supply his/her own distance function.) If the level of measurement is ratio, a ratio distance function (ratio.dist
) is applied. Alternatively, the user may supply his/her own distance function. Said function must handle NA
's gracefully; see the above mentioned built-in distance functions for examples.
Argument method
is used to choose between the customary Alpha methodology and the analytical methodology developed by Hughes: method = "analytical"
or method = "customary"
. For smaller samples Hughes' methodology should be strongly preferred because that approach reduces bias for point estimation and provides much better performing confidence intervals—jackknife intervals, to be precise. For large samples Krippendorff's customary methodology can safely be used for inference, and speeds computation considerably relative to Hughes' jackknife method.
If argument confint
is set to TRUE
, a confidence interval is computed. For Hughes' methodology a jackknife interval is produced. For the customary methodology a bootstrap interval is produced. The bootstrap is done by resampling, with replacement, the rows of data
and then computing the alpha statistic for the resulting matrix. The elements of argument control
are used to control the interval computation.
Value
Function krippendorffs.alpha
returns an object of class "krippendorffsalpha"
, which is a list comprising the following elements.
alpha.hat |
the estimate of alpha. |
boot.sample |
when applicable, the bootstrap sample. |
call |
the matched call. |
coders |
the number of coders. |
confint |
the value of argument |
control |
the list of control parameters. |
data |
the matrix of scores, where rows represent units and columns represent coders. |
eta.hat |
when |
L |
when |
level |
the level of measurement, or a user-dfined distance function. |
MSA |
when |
MSE |
the estimate of within-unit variation. |
MST |
when |
method |
the value of argument |
n_ |
when |
se |
when |
U |
when |
units |
the number of units. |
verbose |
the value of argument |
References
Krippendorff, K. (2013). Computing Krippendorff's alpha-reliability. Technical report, University of Pennsylvania.
Hughes, J. (2022). Toward improved inference for Krippendorff's Alpha agreement coefficient. arXiv.
Examples
# The following data were presented in Krippendorff (2013). This example
# applies Hughes' methodology (the default) to these data. A jackknife
# confidence interval is produced (confint = TRUE). The fit is then
# summarized, and a 99% interval is given.
nominal = matrix(c(1,2,3,3,2,1,4,1,2,NA,NA,NA,
1,2,3,3,2,2,4,1,2,5,NA,3,
NA,3,3,3,2,3,4,2,2,5,1,NA,
1,2,3,3,2,4,4,1,2,5,1,NA), 12, 4)
nominal
fit.nom = krippendorffs.alpha(nominal, level = "nominal", confint = TRUE, verbose = TRUE,
control = list(parallel = FALSE))
summary(fit.nom)
confint(fit.nom, level = 0.99)