cohen.kappa {ANSM5}R Documentation

Calculate Cohen's kappa

Description

cohen.kappa() calculates Cohen's kappa and is used in chapter 10 of "Applied Nonparametric Statistical Methods" (5th edition)

Usage

cohen.kappa(
  y1,
  y2,
  blocks = NULL,
  alternative = c("two.sided", "less", "greater"),
  CI.width = 0.95,
  max.exact.cases = 10,
  nsims.mc = 1e+05,
  seed = NULL,
  do.asymp = FALSE,
  do.exact = TRUE,
  do.CI = FALSE,
  do.mc = FALSE
)

Arguments

y1

Factor of same length as y2, blocks and same levels as y2 and (if blocks not NULL) with 2 levels

y2

Factor of same length as y1, blocks and same levels as y1 and (if blocks not NULL) with 2 levels

blocks

Factor of same length as y1, y2 or NULL (defaults to NULL)

alternative

Type of alternative hypothesis (defaults to two.sided)

CI.width

Confidence interval width (defaults to 0.95)

max.exact.cases

Maximum number of cases allowed for exact calculations (defaults to 10)

nsims.mc

Number of Monte Carlo simulations to be performed (defaults to 100000)

seed

Random number seed to be used for Monte Carlo simulations (defaults to NULL)

do.asymp

Boolean indicating whether or not to perform asymptotic calculations (defaults to FALSE)

do.exact

Boolean indicating whether or not to perform exact calculations (defaults to TRUE)

do.CI

Boolean indicating whether or not to perform confidence interval calculations (defaults to FALSE)

do.mc

Boolean indicating whether or not to perform Monte Carlo calculations (defaults to FALSE)

Value

An ANSMstat object with the results from applying the function

Examples

# Example 10.11 from "Applied Nonparametric Statistical Methods" (5th edition)
cohen.kappa(ch10$dentistA, ch10$dentistB, do.asymp = TRUE, do.exact = FALSE,
  alternative = "greater")

# Example 10.12 from "Applied Nonparametric Statistical Methods" (5th edition)
cohen.kappa(ch10$questionnaire, ch10$demonstration, ch10$items)


[Package ANSM5 version 1.1.0 Index]