code: public double calculateCategoryAgreement(final Object category) {
  		double result = 0;
  		for (ICodingAnnotationItem item : study.getItems()) {
  			int catCount = 0;
  			int otherCatCount = 0;
  			for (IAnnotationUnit annotation : item.getUnits())
  				if (category.equals(annotation.getCategory()))
  					catCount++;
  				else
  					otherCatCount++;
  			result += catCount * (catCount - 1) + otherCatCount * (otherCatCount - 1);
  		}
  		return result / (double) (study.getItemCount()
  				* study.getRaterCount() * (study.getRaterCount() - 1));
  	}
docs: /*public double calculateAgreement(final Object category) {
  This is positive and negative agreement (Feinstein90)
  int agreements = 0;
  int annotations = 0;
  for (IAnnotationItem item : study.getItems()) {
  if (category.equals(item.getAnnotation(0)) && category.equals(item.getAnnotation(1)))
  agreements++;
  if (category.equals(item.getAnnotation(0)))
  annotations++;
  if (category.equals(item.getAnnotation(1)))
  annotations++;
  }
  return (2 * agreements) / (double) annotations;
  }