library(vcd)
data(MSPatients, package="vcd")
For the 3-way table, use indexing to select each patient group
Kappa(MSPatients[,,1])
## value ASE z Pr(>|z|)
## Unweighted 0.2079 0.05046 4.121 3.767e-05
## Weighted 0.3797 0.05167 7.350 1.988e-13
Kappa(MSPatients[,,2])
## value ASE z Pr(>|z|)
## Unweighted 0.2965 0.07850 3.777 1.587e-04
## Weighted 0.4773 0.07303 6.535 6.352e-11
Confidence intervals for Kappa
confint(Kappa(MSPatients[,,1]))
##
## Kappa lwr upr
## Unweighted 0.1090518 0.3068332
## Weighted 0.2784654 0.4809957
confint(Kappa(MSPatients[,,2]))
##
## Kappa lwr upr
## Unweighted 0.1426518 0.4503813
## Weighted 0.3341346 0.6204108
agreementplot(t(MSPatients[,,1]), main = "Winnipeg Patients")
agreementplot(t(MSPatients[,,2]), main = "New Orleans Patients")