Skip to content
Prev 105904 / 398506 Next

cohen kappa for two-way table

Dylan Beaudette wrote:
If I interpret this correctly, you are considering the numbers in A and 
B to be nominal variables representing levels of some data attribute.
What cohen.kappa wants is:

1(type=counts) a matrix of counts where each cell represents the number 
of methods (rows are different methods) that classified the data objects 
into levels (columns are different levels).
2(type=scores) a matrix of scores where each cell represents the level 
assigned by a method (rows again) to a data object (columns are data 
objects here).

If your numbers are counts, you can get a sensible kappa for _each_ matrix.
If your numbers are scores, you can get a sensible kappa by specifying 
type=scores for _each_ matrix
As far as I can see, you are computing a sparsely populated table of the 
two matrices and passing that, and I don't see how that can give a 
meaningful result. I suspect that the numbers might be counts in the 
first place, but they are being used as scores.
I'll let someone who knows more about the classAgreement function deal 
with this.

Jim