04-06-2017 01:37 AM
proc freq data=have order=freq ; tables var1/list missing out=var1_freq; run;
The proc freq above outputs by descending order of frequency of var1.
I need the opposite, which is by ascending order.
And the output only gives the frequency and percentage. How can I get the cumulative freq and cumulative percentage as well? These two should vary depending on how you order the var1.
04-06-2017 02:37 AM
04-06-2017 06:02 AM
04-06-2017 11:06 AM
Example input data and desired output will go a long way toward reducing suggestions that do not answer non-specified requirements. Your first post is change the order. And suggestions follow. After that you request that the cumulative totals be reordered, not in the initial post.
And when you start getting into non-standard behaviors then you get to do a little more work. Not much. Please see:
proc freq data=sashelp.class noprint; tables age / out=agefreq; run; proc sort data=agefreq; by count; run; data want; set agefreq;
cumcount + count; cumpercent + percent; run;
04-06-2017 09:30 PM