BookmarkSubscribeRSS Feed
Alfredo
Fluorite | Level 6

 

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

3 REPLIES 3
Reeza
Super User

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

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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.

Alfredo
Fluorite | Level 6

 

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2714 views
  • 3 likes
  • 3 in conversation