[R] how to use confusionMatrix function in solving multi-classes problem

Hamed Nofal hamednofal85 at gmail.com
Sun Dec 13 11:02:29 CET 2015


Dear Colleagues
I need someone to kindly help me solving this problem.
A sample of 89 patients was tested for 4 tumor types (T1, T2, T3, T4).
The results of the operative predicted T stage and those of the pathology
tests are tabulated in the following table:

     .------------.-----------------------------------------------.
     .            .     Operative predicted T stage  .
     .            ------------------------------------------------.
     . Pathology  .    T1   .   T2  .   T3      T4  .
     .------------.----------------------------------------------.
     .    T1      .        1   .      0  .     0  .     0 .
     .------------.---------------------------------------------.
     .    T2      .        0   .     24 .     2  .     0 .
     .------------.--------------------------------------------.
     .    T3      .        0   .     1  .     49       3 .
     .------------.--------------------------------------------.
     .    T4      .        0   .     0  .       0  .    9 .
     .-----------------------------------------------------------

I need to calculate the sensitivity, specificity,accuracy,positive and
negative prediction values, p-value and kappa value of these tests.
I tried to convert the tabulated results into a two-class (0,1) table and
use the function (confusionMatrix) taking the pathology results as the
(goldstandard), but unfortunately,I got unreasonable output. Most
probably,I used the function wrongly.

Thank you and regards

Hamed

	[[alternative HTML version deleted]]



More information about the R-help mailing list