BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
henryjing
Calcite | Level 5

When I use proc logistic with SCORE statement,

I wonder if there is a way of setting the cut-off value to help decision?

 

I also saw a PRIOREVENT statement in the proc logistic,

I wonder what doese this statement mean?

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
No. If you put validate table in score statement, you can generate Confuse Matrix.


data train valid;
 set sashelp.class;
 if _n_ le 12 then output train;
  else output valid;
run;

proc logistic data=train;
model sex=weight height age/ ctable;
score data=valid out=score;
run;

proc tabulate data=score;
class f_sex i_sex;
table f_sex,i_sex;
run;

View solution in original post

6 REPLIES 6
Ksharp
Super User

proc logistic data=sashelp.class;
model sex=weight height age/ ctable;
run;
henryjing
Calcite | Level 5

Thanks Ksharp,

 

As I have both training and validation set, I would be more interested in the confusion matrix for my validation data. 

 

If you use proc logist data=taining; model y = x1 x2 x3 / CTABLE pprob=0.3; score data= validation; run;, then the confusion matrix from output would be probably for the training set instead of validation set. Am I right? So How can I create a confusion matrix for my validation data?

 

 

Ksharp
Super User
No. If you put validate table in score statement, you can generate Confuse Matrix.


data train valid;
 set sashelp.class;
 if _n_ le 12 then output train;
  else output valid;
run;

proc logistic data=train;
model sex=weight height age/ ctable;
score data=valid out=score;
run;

proc tabulate data=score;
class f_sex i_sex;
table f_sex,i_sex;
run;

henryjing
Calcite | Level 5

Thanks KSharp,

 

When I modified my input like the following:

proc logistic data=train des;
model default=&selected PLOTS / CTABLE pprob=0.5;
score data=valid
out=scoval
outroc=roc;
run;

 

I will have the following warning message:

WARNING: Some plots have more than 5000 observations and are suppressed. Specify the
PLOTS(MAXPOINTS=NONE) option in the PROC LOGISTIC statement to display the plots.

 

However, this message will disappear if I remove the CTABLE STATMENT. 

Ksharp
Super User
You can use the following to suppress these warning info.


ods select none;
proc logistic.........

ods select all;

Rick_SAS
SAS Super FREQ

It looks like there is a complete explanation and example for multinomial response in the SAS note 

Usage Note 22603: Producing an actual-by-predicted table (confusion matrix) for a multinomial respon...

Most of the syntax and ideas should translate to the case of a binary response, since binary is a special case of multinomial.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 7048 views
  • 3 likes
  • 3 in conversation