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

Hello,

 

Is it possible to bring out the numbers of each modality in a modeling procedure.
For example with proc logisctic. What is the option that allows to have the numbers of each modality.

 

Thanks for your help,

Gick

1 ACCEPTED SOLUTION

Accepted Solutions
Gick
Pyrite | Level 9

Hello,

 

I found the solution, I just need to add "Simple" option in proc logistic.

 

Thank you for your response.

 

Gick

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

It is not clear if you already know the two modes or if you want to find them. Regardless, I think your question is asking whether you can create two indicator variables and use them as part of the model. The following program uses PROC FREQ to discover that the variable C has the modes C=3 and C=6. I then use a DATA step to create indicator variables for those conditions. Lastly, I use those indicator variables as part of the model in PROC LOGISTIC:

 

data Have;
input X C Y;
datalines;
0.90 6 1 
0.90 5 0 
0.95 3 0 
0.90 4 0 
0.80 6 0 
0.10 6 0 
0.30 6 0 
0.85 5 1 
0.60 6 1 
0.10 6 0 
0.65 6 0 
0.35 3 0 
0.70 5 0 
1.00 2 1 
0.30 1 0 
0.10 3 0 
0.65 3 0 
0.05 3 1 
0.55 4 0 
0.70 3 1 
0.30 3 1 
0.65 6 1 
0.80 3 1 
0.50 3 1 
0.30 6 0 
;

/* find out that C has modes at C=3 and C=6 */
proc freq data=Have;
table C;
run;

data Want;
set Have;
Mode1 = (C=3);    /* a 0/1 indicator variable */
Mode2 = (C=6);
run;

proc logistic data=Want; 
class Mode1 Mode2;
model y(event='1') = x Mode1 Mode2;
run;
Gick
Pyrite | Level 9

Hello,

 

I found the solution, I just need to add "Simple" option in proc logistic.

 

Thank you for your response.

 

Gick

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 667 views
  • 1 like
  • 2 in conversation