Learn R Programming

broom (version 0.4.0)

kappa_tidiers: Tidy a kappa object from a Cohen's kappa calculation

Description

Tidy a "kappa" object, from the cohen.kappa function in the psych package. This represents the agreement of two raters when using nominal scores.

Usage

## S3 method for class 'kappa':
tidy(x, ...)

Arguments

x
An object of class "kappa"
...
extra arguments (not used)

Value

  • A data.frame with columns
  • typeEither "weighted" or "unweighted"
  • estimateThe estimated value of kappa with this method
  • conf.lowLower bound of confidence interval
  • conf.highUpper bound of confidence interval

Details

Note that the alpha of the confidence interval is determined when the cohen.kappa function is originally run.

See Also

cohen.kappa

Examples

Run this code
library(psych)

rater1 = 1:9
rater2 = c(1, 3, 1, 6, 1, 5, 5, 6, 7)
ck <- cohen.kappa(cbind(rater1, rater2))

tidy(ck)

# graph the confidence intervals
library(ggplot2)
ggplot(tidy(ck), aes(estimate, type)) +
    geom_point() +
    geom_errorbarh(aes(xmin = conf.low, xmax = conf.high))

Run the code above in your browser using DataLab