kappaCohen {KappaGUI} | R Documentation |
Calculates Cohen's kappa for all pairs of columns in a given dataframe
Description
This function is based on the function 'kappa2' from the package 'irr', and simply adds the possibility of calculating several kappas at once.
Usage
kappaCohen(data, weight="unweighted")
Arguments
data |
dataframe with |
weight |
character string specifying the weighting scheme ("unweighted", "equal" or "squared"). See the function ‘kappa2’ from the package ‘irr’. |
Details
For each trait, only complete cases are used for the calculation.
Value
A dataframe with p
rows (one per trait) and three columns, giving respectively the kappa value for each trait, the number of individuals used to calculate this value, and the associated p
-value.
Author(s)
Frédéric Santos, frederic.santos@u-bordeaux.fr
References
Cohen, J. (1960) A coefficient of agreement for nominal scales. Educational and Psychological Measurement, 20, 37–46.
Cohen, J. (1968) Weighted kappa: Nominal scale agreement with provision for scaled disagreement or partial credit. Psychological Bulletin, 70, 213–220.
See Also
irr::kappa2
Examples
# Here we create and display an artifical dataset,
# describing two traits coded by two raters:
scores <- data.frame(
Trait1_A = c(1,0,2,1,1,1,0,2,1,1),
Trait1_B = c(1,2,0,1,2,1,0,1,2,1),
Trait2_A = c(1,4,5,2,3,5,1,2,3,4),
Trait2_B = c(2,5,2,2,4,5,1,3,1,4)
)
scores
# Retrieve Cohen's kappa for Trait1 and Trait2,
# to evaluate inter-rater agreement between raters A and B:
kappaCohen(scores, weight="unweighted")
kappaCohen(scores, weight="squared")