BookmarkSubscribeRSS Feed
2 REPLIES 2
yabwon
Amethyst | Level 16

Hi @YoloY 

 

It looks like you are a "fresher" here at communities.sas.com, let me share some  advise to help you get help faster.

 

If you want us to help you modify your code:

1) paste the code, not a print screen of the code,

2) explain what/how would you like the code to be modified...

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



YoloY
Calcite | Level 5

Thank you for your advice. I want to add adjusted variables in the process of proc logistic. The code as follows:

%macro WMWodds(_DATASET, _GROUP, _Y) ;
ods listing close ;
proc npar1way data=&_DATASET. correct=no ;
class &_GROUP. ;
var &_Y. ;
ods output WilcoxonScores=WS(keep=Class SumOfScores) ;
run ;
proc transpose data=WS out=FLAG prefix=WSCORE_ ;
var SumOfScores ;
id CLASS ;
run ;
data _NULL_ ;
set FLAG ;
if (WSCORE_1 >= WSCORE_2) then call symput("_FLAG",1);
else call symput("_FLAG",2);
run ;
proc logistic data=&_DATASET. ;
class &_GROUP. ;
model &_GROUP.=&_Y. ;
roc ;
ods output ROCAssociation=AUROC ;
run ;
ods listing ;

data WMWODDS ;
set AUROC ;
if (&_FLAG=1) then do ;
WMWOdds=Area/(1-Area) ;
SE =StdErr/(1-Area)**2 ;
LnWMW =log(Area/(1-Area)) ;
LnSE =StdErr/(Area*(1-Area)) ;
end ;
else do ;
WMWOdds=(1-Area)/Area ;
SE =StdErr/Area**2 ;
LnWMW =log((1-Area)/Area) ;
LnSE =StdErr/(Area*(1-Area)) ;
end ;
z =quantile("NORMAL",0.975) ;
LowerCI =WMWOdds - z*SE ;
UpperCI =WMWOdds + z*SE ;
LowerCI_exp=exp(LnWMW - z*LnSE) ;
UpperCI_exp=exp(LnWMW + z*LnSE) ;
if _n_=1;
keep Area StdErr WMWOdds SE LowerCI UpperCI
LowerCI_exp UpperCI_exp ;
run ;
title "&_DATASET." ;
proc print noobs ;
run ;
%mend ;

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 844 views
  • 0 likes
  • 2 in conversation