Load packages and data
library(vcd)
data(MSPatients, package="vcd")
Calculate Kappa for each set of patients
For the 3-way table, use indexing to select each patient group
Kappa(MSPatients[,,1])
## value ASE z Pr(>|z|)
## Unweighted 0.208 0.0505 4.12 3.77e-05
## Weighted 0.380 0.0517 7.35 1.99e-13
Kappa(MSPatients[,,2])
## value ASE z Pr(>|z|)
## Unweighted 0.297 0.0785 3.78 1.59e-04
## Weighted 0.477 0.0730 6.54 6.35e-11
Confidence intervals for Kappa
confint(Kappa(MSPatients[,,1]))
##
## Kappa lwr upr
## Unweighted 0.109 0.307
## Weighted 0.278 0.481
confint(Kappa(MSPatients[,,2]))
##
## Kappa lwr upr
## Unweighted 0.143 0.45
## Weighted 0.334 0.62
Agreement plots
agreementplot(t(MSPatients[,,1]), main = "Winnipeg Patients")
agreementplot(t(MSPatients[,,2]), main = "New Orleans Patients")
IycgLS0tDQojJyB0aXRsZTogIk1TUGF0aWVudHM6IEFncmVlbWVudCINCiMnIGF1dGhvcjogIk1pY2hhZWwgRnJpZW5kbHkiDQojJyBkYXRlOiAiYHIgZm9ybWF0KFN5cy5EYXRlKCkpYCINCiMnIG91dHB1dDoNCiMnICAgaHRtbF9kb2N1bWVudDoNCiMnICAgICB0aGVtZTogcmVhZGFibGUNCiMnICAgICBjb2RlX2Rvd25sb2FkOiB0cnVlDQojJyAtLS0NCg0KIysgZWNobz1GQUxTRQ0Ka25pdHI6Om9wdHNfY2h1bmskc2V0KA0KICB3YXJuaW5nID0gRkFMU0UsICAgIyBhdm9pZCB3YXJuaW5ncyBhbmQgbWVzc2FnZXMgaW4gdGhlIG91dHB1dA0KICBtZXNzYWdlID0gRkFMU0UNCikNCg0KIycgTG9hZCBwYWNrYWdlcyBhbmQgZGF0YQ0KbGlicmFyeSh2Y2QpDQpkYXRhKE1TUGF0aWVudHMsIHBhY2thZ2U9InZjZCIpDQoNCiMnICMjIENhbGN1bGF0ZSBLYXBwYSBmb3IgZWFjaCBzZXQgb2YgcGF0aWVudHMNCiMnIEZ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