Programming the statistical procedures from SAS

False POS/NEG Rate incorrect in PROC LOGISTIC

Reply
Occasional Contributor
Posts: 8

False POS/NEG Rate incorrect in PROC LOGISTIC

[ Edited ]

 

I don’t agree on the way that PROC LOGISTIC calculates false positive/negative rates using CTABLE option. If you try this code, you’ll see a value 26.7 and 25.0 respectively for the false POSITIVE and false NEGATIVE rate instead of 40 and 15.4.

 

data FatComp;

   input Test Response Count;

datalines;

0 0  6

0 1  2

1 0  4

1 1 11

;

run;

proc logistic data=FatComp ;

model response (event='1') = test  / ctable pprob=(.5); freq count;

run;

  

                          Classification Table

          Correct      Incorrect                Percentages

 Prob          Non-          Non-           Sensi-  Speci-  False  False

Level  Event  Event  Event  Event  Correct  tivity  ficity   POS    NEG

0.500     11      6      4      2     73.9    84.6    60.0   26.7   25.0

 

Should be calculated as:

 

False Positive Rate = (4 / (6+4)) = 40

False Negative Rate = (2 / (2+11)) = 15.4

Super User
Posts: 18,586

Re: False POS/NEG Rate incorrect in PROC LOGISTIC

[ Edited ]

Differing terminology, but easily confusing.

False Positive = FP/(Positives) = 4/ (4+ 11) = 0.26666
False Negative=FN/Negative = 2/8 = 0.25
EDIT:

I guess they use different definitions:

 

The false positive rate is the proportion of predicted event responses that were observed as nonevents. The false negative rate is the proportion of predicted nonevent responses that were observed as events.

 


http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_logistic_sec...


https://en.wikipedia.org/wiki/Sensitivity_and_specificity

Valued Guide
Valued Guide
Posts: 684

Re: False POS/NEG Rate incorrect in PROC LOGISTIC

THose last columns in the output are often known as "predictive values" (false positive predictive values). These are estimates of posterior probabilities. You can get your false positive and false negative percentages by simply subtracting sensitivity and specificy (both in the table) from 100.

Occasional Contributor
Posts: 8

Re: False POS/NEG Rate incorrect in PROC LOGISTIC

 

In fact, Reeza, they use different (wrong?) definitions.

According with your link https://en.wikipedia.org/wiki/Sensitivity_and_specificity proc logistic seems to calculate the False Discovery Rate  FDR = FP / (FP + TP) instead of the False Positive Rate FPR = FP / (FP + TN )

 

In the example above we have TN=6; FP=4; FN=2; TP=11 so the FPR is 4 / (4 +6) = 0.40

and the FDR is 4 /(4+11) = 0.266 as reported in proc logistic output.

Ask a Question
Discussion stats
  • 3 replies
  • 272 views
  • 0 likes
  • 3 in conversation