creating ROC curve with Sensitivity and 1- specificity in R -


i have created 2x2 contingency table.the contingency table created through following process:

plus <- ua.mask + vm.c.m.s; minus <-ua.mask - vm.c.m.s; 

here, ua.mask , vm.c.m.s raster layers(can considered matrix) cells given values 0 (for non urban areas) , 1(for urban).ua.mask reference map , vm.c.m.s map accuracy want check.

 m <- matrix(0, nrow=2, ncol=2)  m[1,1] <- length(which(plus[]==2)) m[1,2] <- length(which(minus[]==-1)) m[2,1] <- length(which(minus[]==1)) m[2,2] <- length(which(plus[]==0)) 

so, when add , subtract these raster layers cells have values of 1,-1,0 , 2. means, have 4 possible outcomes 2 =tp, -1 = fp, 1=tp, 0 =tn. at, end 2x2 contingency table looks this:

          [,1]      [,2]     [1,]  2           -1     [2,]  1           0 

then, calculated sensitivity (tpr) , 1-specificity(fpr).

now, plot pairs of sensitivity , 1-specificity create roc curve (sensitivity vs. 1-specificity) cities, can't figure out how this.

i went through rocr package in r couldn't understand how function (prediction , perform) works in case.

or, input datas correct roc-curves?

any can provide appreciated!

thanks!


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -