Nclasstest {Multiclasstesting}R Documentation

Multi-class Statistical Scores

Description

This function allows the computation of statistical scores for the evaluation of the performances of a n-ary classification test. In fact, it extends the concepts of Sensitivity (Se), Specificity (Sp), Positive Predictive Value (PPV) and Negative Predictive Value (NPV) -defined for binary tests- to any number of classes.

Usage

Nclasstest(T, GS)

Arguments

T A matrix or vector from testing results, wherein the element represents the class type.
GS A matrix or vector from Gold Standard results, wherein the element represents the class type.

Details

Specificity, sensitivity, negative and positive predictive value are used in combination to quantify different aspects of the accuracy of a binary test, evaluating different proportions of correctly and incorrectly classified items, when compared to a known classification, considered the gold standard. In this context the test is the ensemble of all the operations performed to classify each items; positive and negatives label the items according to the two classes c=N, P= 0,1 they belong to: true (T) and false (F) represent the ability of the test to classify coherently or not a given item in the test classification with respect to the gold standard classification.

Value

binary.performance A matrix of statistical scores for both binary and multiple classes test, including PPV, NPV, Se and Sp.
multi.performance A matrix of statistical scores for multiple classes test , including predictive value (PV) and Sensitivity/Specificity (S) of each class.


In multiple test case, the PPV and Se from binary.performance summarize the performance of all the positive (non-zero) classifications, while NPV and Sp evaluate the negative (zero) classification performance.

Note

The test results T and the reference results GS should have the same dimensions.

Author(s)

Nardini, C. and Liu, Y-H.

References

C. Nardini, H. Peng, L. Wang, L. Benini, M.D. Kuo, MM-Correction: Meta-analysis-Based Multiple Hypotheses Correction in Omic Studies? Springer CCIS, 25 , pp 242–255, 2008.

Examples

# ######Binary test ########
GS<-cbind(c(0, 1),c(0, 0),c(1, 1))
 T <-cbind(c(1, 1),c(1, 0),c(1, 1))
 Nclasstest(T,GS)
 
# binary.performance 
#      PPV  NPV   Se     Sp 
#[1,] 0.6    1     1     0.3333333
 
#########Multiple classes test #######
 GS <- cbind(c(0, -1, 1), c(0, 1, 0), c(1, 0, 1)) 
 T <- cbind(c(1, -1, 1), c(0, 1, -1), c(0, 1, 1)) 
 Nclasstest(T, GS) 
 
# multi.performance 
#      class.type   PV       S 
#   1      -1       1.00    0.5 
#   2       0       0.25    0.5 
#   3       1       0.75    0.6 

# binary.performance 
#          PPV     NPV   Se     Sp 
#[1,] 0.5714286   0.5    0.8   0.25 

        


[Package Multiclasstesting version 1.2.0 Index]