See the attached file. Thank you in advance.
Hello @khalidamin,
If you just need a dataset containing class variable names and their reference categories (which you could then "interleave" with an odds ratio table where the reference categories are omitted), you can use the ClassLevelInfo ODS output dataset:
ods output ClassLevelInfo=cli;
proc logistic ...;
...
run;
data reflevels(keep=clvar value);
set cli;
if class ne ' ' then clvar=class;
if max(of x:)=0;
retain clvar;
run;
Alternatively, you could start with the OddsRatios ODS output dataset. But unfortunately variable Effect in this dataset contains concatenated strings like 'gender 1 vs 0' so that you would need to work with character functions such as SCAN to extract variable names and values. This might become difficult in general, e.g., if values (or even variable names) contain blanks or the substring "vs", etc.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.