Hello
I am using proc univariate to calculate percentiles 10,20,30,40,50,60,70,80,90,100
The outcome data set is called pctls and is getting the values
Data pctls;
input REVENUEpct10 REVENUEpct20 REVENUEpct30 REVENUEpct40 REVENUEpct50 REVENUEpct60 REVENUEpct70 REVENUEpct80 REVENUEpct90 REVENUEpct100;
cards;
0 0 0 4 94.4325 1642.59 7241.93 18418.335 44282.98 27846721.81
;
Run;
Then I want to build formats
proc transpose
data=pctls
out=p_long;
var _all_;
run;
data cntlin;
set p_long;
length label $100.;
fmtname = "RevenueFmt";
type = "N";
start = ifn(_n_ = 1,0,lag(col1));
end = col1;
label = catx(" ","group_Revenue",_n_,"start:",start,"end:",end);
keep fmtname type start end label;
run;
proc format cntlin=cntlin;
run;
The problem is values 0-0 are overlapped.
What do you suggest to do in order to solve this problem and build the format well?
So this means that 30+ percent of your population have a zero value. I would discard the lower percentiles having a zero value:
data p_long2;
set p_long;
by col1,
if last.col1;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.