[R] Data manipulation help

About this list Date view Thread view Subject view Author view Attachment view

From: Andrew Perrin (clists@perrin.socsci.unc.edu)
Date: Wed 30 Apr 2003 - 06:30:29 EST


Message-id: <Pine.LNX.4.53.0304291623030.28395@perrin.socsci.unc.edu>

I have a data frame that contains two ratings on several variables for
each case. My objective at the moment is to calculate a Cohen's Kappa
score for each of these variables between the two raters. Jim Lemon has
kindly provided me with kappa.nom() to do the calculation, but I'm having
trouble getting the data into the right format.

Consider the variable "conv". It's now stored in a data frame such that
letters.df$first.conv contains the first coder's evaluation for conv, and
letters.df$second.conv contains the second coder's evaluation for conv.
The levels for all these factors are c(-1,0,1). kappa.nom() requires a
frequency table, such that for each case we have:

      -1 0 1
       2 0 0

That is, the count of ratings of -1 (in this case, both coders assigned
-1), the count of 0, and the count of 1. Is there a relatively easy way
to do this?

Many thanks.

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:44 EST