09-09-2014 07:02 AM
I have been searching for this very simple thing. Creating a frequency table with certain increament steps
Let us say I have a continous variable taking values 1-100 and I have a thousand observations of that variable
What is the easiest wat to create a frequency table with a specific increamtnet, ie in groups of 10 or 20 or anything??
Using proc freq with formats seems a bit complicated for this task, or am i worng?
09-09-2014 07:57 AM
One solution can be to define a format with relevant ranges. Do this with the cntlin option allows you to benefit of the do-loop in a datastep:
do i=0 to 100;
do start=0 to 100 by 5;
proc format cntlin=myformat;
proc freq data=abc;
format i myformat.;
09-09-2014 09:46 AM
OR you could try proc rank to split these data into a couple of groups.
data abc; do i=1 to 100; output; END; run; proc rank data=abc out=temp groups=10; var i; ranks group; run; proc freq noprint data=temp; by group; tables i/out=want nocum nopercent; run;