Hi ,
My code is generating the waterfall
data adtr_2;
set adtr;
postion+1;
run;
ods listing close;
ods graphics/reset = all imagename="14_2_9_1_waterfall" width=10.0in height=7.0in;
proc sgplot data=adtr_2;
refline 50/ axis = y
labelloc = outside
labelpos = auto
lineattrs=(pattern=shortdash color=black)
label = "50 % Reduction from Baseline";
refline -50/ axis = y
labelloc = outside
labelpos = auto
lineattrs=(pattern=shortdash color=black)
label = "-50 % Reduction from Baseline";
vbar subjid/response = pchg ;
xaxis label = "Patient Number" fitpolicy = ROTATE;
yaxis label = "Maximum Percent Reduction from Baseline in SPD" min=-100 max=100 values=(-100 to 100 by 20);
run;
I want the Bars order by PCHG value rather than SUBJID and display the SUBJID as labels for bars.
When i use the POSTION var ,below output one is coming , but i want the SUBJID display instead of POSTION values in x axis labels
vbar postion/response = pchg ;
my data :
Thank you,
Raja.
What you want is the following:
vbar subjid/response = pchg categoryorder=respdesc;
This will put the bars in descending response order.
What you want is the following:
vbar subjid/response = pchg categoryorder=respdesc;
This will put the bars in descending response order.
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.