R/lkappa.R

Defines functions lkappa

Documented in lkappa

#' @export
lkappa <-
  function(r, type="Cohen", weights="squared")
  {
    nrater <- dim(r)[2]
    kappas <- vector(length = nrater * (nrater - 1)/2)
    c <- 0
    for (i in 2:nrater) for (j in 1:(i - 1))
    {
      c <- c + 1
      if (type == "Cohen") kappas[c] <- ckappa(r[, c(i, j)])[[2]]
      else  kappas[c] <- wkappa(r[, c(i, j)], weights=weights)[[3]]
    }
    return(mean(kappas))
  }

Try the psy package in your browser

Any scripts or data that you put into this service are public.

psy documentation built on April 22, 2022, 1:08 a.m.