krippendorffs.alpha: Apply Krippendorff's Alpha.

View source: R/krippendorff.R

krippendorffs.alphaR Documentation

Apply Krippendorff's Alpha.

Description

Apply Krippendorff's Alpha.

Usage

krippendorffs.alpha(
  data,
  level = c("interval", "nominal", "ordinal", "ratio"),
  confint = TRUE,
  verbose = FALSE,
  control = list()
)

Arguments

data

a matrix of scores. Each row corresponds to a unit, each column a coder.

level

the level of measurement, one of "nominal", "ordinal", "interval", or "ratio"; or a user-defined distance function.

confint

logical; if TRUE, a bootstrap sample is produced.

verbose

logical; if TRUE, various messages are printed to the console. Note that if confint = TRUE a progress bar (pblapply) is displayed (if possible) during the bootstrap computation.

control

a list of control parameters.

bootit

the size of the bootstrap sample. This applies when confint = TRUE. Defaults to 1,000.

nodes

the desired number of nodes in the cluster.

parallel

logical; if TRUE (the default), bootstrapping is done in parallel.

type

one of the supported cluster types for makeCluster. Defaults to "SOCK".

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.

If argument confint is set to TRUE, bootstrapping is carried out. This 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 bootstrap computation.

Value

Function krippendorffs.alpha returns an object of class "krippendorffsalpha", which is a list comprising the following elements.

boot.sample

when applicable, the bootstrap sample.

call

the matched call.

coders

the number of coders.

alpha.hat

the estimate of alpha.

confint

the value of argument confint.

control

the list of control parameters.

data

the matrix of scores.

D.e

the estimate of total variation.

D.o

the estimate of within-unit variation.

level

the level of measurement.

units

the number of units.

verbose

the value of argument verbose.

References

Krippendorff, K. (2013). Computing Krippendorff's alpha-reliability. Technical report, University of Pennsylvania.

Examples

# The following data were presented in Krippendorff (2013).

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(bootit = 100, parallel = FALSE))
summary(fit.nom)
confint(fit.nom, level = 0.99)

drjphughesjr/krippendorffsalpha documentation built on April 3, 2022, 5:52 a.m.