StatsKappa: Cohen's Kappa

Description Usage Arguments See Also Examples

Description

Bayesian alternative to Cohen's kappa

Usage

1
2
StatsKappa(x = NULL, x.names = NULL, DF, params = NULL,
  initial.list = list(), ...)

Arguments

x

predictor variable(s), Default: NULL

x.names

optional names for predictor variable(s), Default: NULL

DF

data to analyze

params

define parameters to observe, Default: NULL

initial.list

initial values for analysis, Default: list()

...

further arguments passed to or from other methods

See Also

complete.cases

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Simulate rater data
Rater1 <- c(rep(0,20),rep(1,80))
set.seed(100)
Rater2 <- c(rbinom(20,1,0.1), rbinom(80,1,0.9))
data <- data.frame(Rater1,Rater2)


mcmc <- bfw(project.data = data,
            x = "Rater1,Rater2",
            saved.steps = 50000,
            jags.model = "kappa",
            jags.seed = 100,
            silent = TRUE)


# Print frequentist and Bayesian kappa
library(psych)
psych::cohen.kappa(data)$confid[1,]
#  lower     estimate  upper
#  0.6137906 0.7593583 0.9049260
#' \donttest{ mcmc$summary.MCMC }
#             Mean     Median    Mode      ESS   HDIlo    HDIhi    n
#  Kappa[1]:  0.739176 0.7472905 0.7634503 50657 0.578132 0.886647 100

bfw documentation built on May 2, 2019, 6:51 a.m.