calc_pw_kappa: Calculate pairwise agreement statistics for multiple raters

View source: R/calc_pw_kappa.R

calc_pw_kappaR Documentation

Calculate pairwise agreement statistics for multiple raters

Description

This function calculates pairwise agreement statistics for multiple raters. It computes statistics such as pairwise kappa (both unweighted and weighted) and the proportion of observed agreement. It summarizes these statistics in a table or data frame.

Usage

calc_pw_kappa(data, ..., type = "unweighted")

Arguments

data

A data frame or tibble containing the ratings from multiple raters.

...

Variable (column) names of the raters in the data.

type

A character string indicating whether to calculate "unweighted" or "weighted" kappa.

Value

A list containing the results and tables of the pairwise agreement statistics, including kappa results and observed agreement.

Examples

diagnostic_df <- data.frame(stringsAsFactors = FALSE,
  id = c(1:30),
  rater_1 = c("Yes", "No", "No", "No", "No", "No", "No", "No", "No", "No",
              "No", "No", "No", "No", "No", "No", "No", "No", "No", "No",
              "No", "Yes", "No", "No", "No", "No", "No", "No", "No", "No"),
  rater_2 = c("Yes", "No", "No", "No", "No", "No", "No", "No", "No", "No",
              "Yes", "No", "No", "Yes", "No", "No", "No", "No", "No", "No",
              "No", "Yes", "No", "No", "Yes", "No", "No", "No", "No", "No"),
  rater_3 = c("Yes", "No", "No", "No", "No", "No", "No", "No", "Yes", "No",
              "Yes", "Yes", "No", "Yes", "Yes", "No", "No", "No", "Yes", "No",
              "No", "Yes", "Yes", "Yes", "Yes", "No", "No", "Yes", "No", "No")
)

results <- calc_pw_kappa(diagnostic_df, rater_1, rater_2, rater_3, type = "unweighted")
names(results)
results$k_table
results$k_min_max
results$po_table
results$po_min_max


emilelatour/lamisc documentation built on March 29, 2025, 1:23 p.m.