kappa_matrix: Kappa matrix

View source: R/kappa_matrix.R

kappa_matrixR Documentation

Kappa matrix

Description

Kappa matrix of cohen's kappa values

Usage

kappa_matrix(ConfMatrix, acc = 2)

Arguments

ConfMatrix

A confusion matrix made using confusion_matrix(model1, model2)

acc

The accuracy of the results, defaults to 2 decimal places

Value

Unweighted and weighted Kappa value computed using the cohen.kappa() function from the psych R package

Examples

data(bmi_long, package='LCTMtools')
require(lcmm)
require(psych)
model1 <- hlme(fixed = bmi ~ age,
mixture= ~ age,
random= ~ age,
nwg=TRUE, ng=2, subject="id", data=data.frame(bmi_long[1:500, ]))

model2 <- hlme(fixed = ~ age,
mixture= ~ age,
random= ~1, nwg=FALSE, ng=2, subject="id", data=data.frame(bmi_long[1:500, ]))
ConfMatrix <- confusion_matrix(model1, model2)
kappa_matrix(ConfMatrix)

hlennon/LCTMtools documentation built on Dec. 6, 2022, 3:04 a.m.