Search code examples
sas

Proc freq: frequencies over the total


is there a way to divide the "count" from proc freq by the total number of rows of a data set? My proc freq is the following:

proc freq noprint data=mydata;
by place; table weight / out=freqs;
run;

I don't want % on classes by over the total.

Thank you in advance


Solution

  • Don't use a by-group. This will create individaul calculations per group. Instead, create a table of weight*place.

    proc freq noprint data=mydata;
        table weight*place / out=freqs;
    run;