kappa_matrix | R Documentation |
Kappa matrix of cohen's kappa values
kappa_matrix(ConfMatrix, acc = 2)
ConfMatrix |
A confusion matrix made using confusion_matrix(model1, model2) |
acc |
The accuracy of the results, defaults to 2 decimal places |
Unweighted and weighted Kappa value computed using the cohen.kappa() function from the psych R package
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.