BookmarkSubscribeRSS Feed
richardxy
Calcite | Level 5

Hi all,

I'm relatively new to SAS and the community, really appreciate the chance for getting help here. Thanks in advance for any help I may get.

I am running Proc Logistic to build a logistic regression model, and just found that I got two drastically different c statistic value with or without having the option plots=ROC in the Proc Logistic statement. It seems very confusing to me and I have no idea about the reason. A intense Google search didn't find anything.

My code is like this

Proc Logistic data=mydata desc;

weight wgt;

model target=&vars;

ouput out=myout p=p;

run;

The c statistic in the result is 0.552. Percent Concordant is 10.3, and Percent Tied is 89.6. Gamma is 0.996.

Then I turned plots=ROC on, and my code now looks like this.

Proc Logistic data=mydata desc plots=ROC;

weight wgt;

model target=&vars;

ouput out=myout p=p;

run;

The c statistic becomes 0.929, Percent Concordant is 92.4, Percent Tied is 0.9, and Gamma is 0.865. They all are very different from the previous set of values.

Anyone can share your insight into this? Why adding plots=ROC changes the value of results?

thanks,

Richard

4 REPLIES 4
Reeza
Super User

It shouldn't but we can't see what &vars is. 

If it truly is different with the exact same data you should post the output from the runs as well, and contact tech support.

richardxy
Calcite | Level 5

Thanks Reeza for your reply.

&vars is just a string of variables, and it carries the same value for both runs. Will try the tech support.

Reeza
Super User

It doesn't happen when I run with plots=roc vs without, not using weights.

I noticed you are using Weights, so you may want to consider this note:

Caution:PROC LOGISTIC does not compute the proper variance estimators if you are analyzing survey data and specifying the sampling weights through the WEIGHT statement. The SURVEYLOGISTIC procedure is designed to perform the necessary, and correct, computations.

richardxy
Calcite | Level 5

I found another post which asked the same question and had an answer.

I need to specify binwidth=o and roceps=0 for Model statement, if plots=ROC is not used. The result proves that.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 4 replies
  • 4141 views
  • 0 likes
  • 2 in conversation