public void KappaVarianceTest3()
{
// Example from J. L. Fleiss, J. Cohen, B. S. Everitt, "Large sample
// standard errors of kappa and weighted kappa" Psychological Bulletin (1969)
// Volume: 72, Issue: 5, American Psychological Association, Pages: 323-327
// This was the paper which presented the finally correct
// large sample variance for Kappa after so many attempts.
double[,] matrix =
{
{ 0.53, 0.05, 0.02 },
{ 0.11, 0.14, 0.05 },
{ 0.01, 0.06, 0.03 },
};
GeneralConfusionMatrix a = new GeneralConfusionMatrix(matrix, 200);
Assert.AreEqual(a.RowProportions[0], .60, 1e-10);
Assert.AreEqual(a.RowProportions[1], .30, 1e-10);
Assert.AreEqual(a.RowProportions[2], .10, 1e-10);
Assert.AreEqual(a.ColumnProportions[0], .65, 1e-10);
Assert.AreEqual(a.ColumnProportions[1], .25, 1e-10);
Assert.AreEqual(a.ColumnProportions[2], .10, 1e-10);
Assert.AreEqual(0.429, a.Kappa, 1e-3);
Assert.IsFalse(double.IsNaN(a.Kappa));
Assert.AreEqual(0.002885, a.Variance, 1e-6);
Assert.AreEqual(0.003082, a.VarianceUnderNull, 1e-6);
Assert.IsFalse(double.IsNaN(a.Variance));
Assert.IsFalse(double.IsNaN(a.VarianceUnderNull));
}