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
Post a Comment