BookmarkSubscribeRSS Feed
2 REPLIES 2
yabwon
Meteorite | Level 14

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 ;

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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