| Title: | Krippendorff's Alpha for Multi-Valued Data |
|---|---|
| Description: | Calculate Krippendorff's alpha for multi-valued data using the methods introduced by Krippendorff and Craggs (2016) <doi:10.1080/19312458.2016.1228863>. Nominal, ordinal, interval, and ratio data types are supported, with options to create bootstrapped estimates of alpha and/or parallelize calculations. |
| Authors: | Corie Drake [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-1517-7103>) |
| Maintainer: | Corie Drake <[email protected]> |
| License: | AGPL (>= 3) |
| Version: | 0.5.0 |
| Built: | 2026-05-16 06:23:52 UTC |
| Source: | https://github.com/therealcfdrake/mvalpha |
These data represent examples found in the original paper describing the calculation of multi-valued Krippendorff's alpha by Krippendorff and Craggs (2016).
ex_table3 ex_table8a ex_table8b ex_table8c ex_table9a ex_table9b ex_table9cex_table3 ex_table8a ex_table8b ex_table8c ex_table9a ex_table9b ex_table9c
Each is a multi-valued nominal set with observers as columns and units as rows.
https://doi.org/10.1080/19312458.2016.1228863
Krippendorff K, Craggs R (2016). “The Reliability of Multi-Valued Coding of Data.” Communication Methods and Measures, 10(4), 181–198. doi:10.1080/19312458.2016.1228863. https://doi.org/10.1080/19312458.2016.1228863.
mvalpha() calculates Krippendorff's alpha statistic when multi-valued observers are
allowed to apply multiple values to an observation.
mvalpha( data, type = "nominal", verbose = TRUE, n_boot = NULL, parallelize = FALSE, cluster_size = NULL )mvalpha( data, type = "nominal", verbose = TRUE, n_boot = NULL, parallelize = FALSE, cluster_size = NULL )
data |
a data frame containing a list column for each observer. Each row represents
an observation unit, and each cell contains a vector of 0 to |
type |
a string describing the data type of the label set. This can be "nominal", "ordinal", "interval", or "ratio" and is used to select the appropriate distance metric. |
verbose |
a logical value which toggles whether status updates are printed to the console while alpha is being calculated. |
n_boot |
an integer representing the number of bootstrap estimates to calculate
for mvDo. The default, |
parallelize |
a logical value indicating whether to implement parallelization
using the |
cluster_size |
an integer describing the number of cores to allocate to parallelization.
If |
An object of class mvalpha
Krippendorff K, Craggs R (2016). “The Reliability of Multi-Valued Coding of Data.” Communication Methods and Measures, 10(4), 181–198. doi:10.1080/19312458.2016.1228863. https://doi.org/10.1080/19312458.2016.1228863.
library(mvalpha) ### replicate example from Table 3 in Krippendoff and Craggs (2016) with bootstrapped estimates # View data ex_table3 # Estimate alpha x <- mvalpha(ex_table3, verbose = TRUE, n_boot = 500) # View result x # View the unique values observed in the data x$values # View the unique labels used to code the data x$labels # Histogram of bootstrapped estimates hist(x$bootstrap_mvalpha)library(mvalpha) ### replicate example from Table 3 in Krippendoff and Craggs (2016) with bootstrapped estimates # View data ex_table3 # Estimate alpha x <- mvalpha(ex_table3, verbose = TRUE, n_boot = 500) # View result x # View the unique values observed in the data x$values # View the unique labels used to code the data x$labels # Histogram of bootstrapped estimates hist(x$bootstrap_mvalpha)
Wrapper for creating mvalpha class object.
new_mvalpha( mvalpha, type, mvDo, mvDe, bootstrap_mvalpha, unique_cardinalities, units, observers, labels, values, values_by_unit, dist_CK, p_CK, data )new_mvalpha( mvalpha, type, mvDo, mvDe, bootstrap_mvalpha, unique_cardinalities, units, observers, labels, values, values_by_unit, dist_CK, p_CK, data )
mvalpha |
Multi-valued alpha estimate |
type |
a string describing the data type of the label set. This can be "nominal", "ordinal", "interval", or "ratio" and is used to select the appropriate distance metric. |
mvDo |
Observed disagreement |
mvDe |
Expected disagreement |
bootstrap_mvalpha |
Bootstrap estimates of mvalpha |
unique_cardinalities |
Numeric vector of the unique cardinalities observed in the data |
units |
Names of units |
observers |
Names of observers |
labels |
Unique labels used in data |
values |
Unique values used in data |
values_by_unit |
Table of values by unit |
dist_CK |
Distance matrix for label sets C and K |
p_CK |
Probability matrix for label sets C and K |
data |
a data frame containing a list column for each observer. Each row represents
an observation unit, and each cell contains a vector of 0 to |
an mvalpha object
Print generic
## S3 method for class 'mvalpha' print(x, ...)## S3 method for class 'mvalpha' print(x, ...)
x |
mvalpha object |
... |
additional parameters |
invisibly returns the alpha estimate of an mvalpha object
Find the intersection and set difference(s) of two sets all at once and more
efficiently than calling base::intersect() and base::setdiff() separately.
Based on this stackoverflow answer https://stackoverflow.com/a/72631719
set_ops(A, B, type)set_ops(A, B, type)
A, B
|
sets (vectors) of elements |
type |
a string describing the data type of the label set. This can be "nominal", "ordinal", "interval", or "ratio" and is used to select the appropriate distance metric. |