Hey @GS2 ,
is this what you are looking for?
data have;
infile datalines delimiter=',';
input id impingment_point cum_pct;
datalines;
1,33,2
2,120,100
3,80,80
4,60,59
5,45,19
;
run;
proc format;
value impng_cat 0 - 19.99 = '0-19'
20 - 39.99 = '20-39'
40 - 59.99 = '40-59'
60 - 79.99 = '60-79'
80 - 99.99 = '80-99'
100 - 119.99 = '100-119'
120 - 139.99 = '120-139';
run;
proc sgplot data= have;
format impingment_point impng_cat.;
vbar impingment_point;
vline impingment_point / response=cum_pct y2axis;
xaxis label= '' type=discrete;
yaxis values=(0 5 10 15 20 25 30 35 40 45) label= 'Number of Patients';
label cum_pct = 'Cumulative Percent';
run;
For posting code in the future please use the Insert SAS Code Button in the editor.
For the display of a bar without any values I have no solution other than to add a row per missing value, not ideal I know but maybe color the missing value bar with something like mentioned here: https://communities.sas.com/t5/Graphics-Programming/How-to-make-a-bar-chart-and-assign-the-bar-color-based-on-the/td-p/190107
Hope this helps and kind regards
David
... View more