For example, running proc freq on the following data:
data test;
input class :$9. gender :$1.;
cards;
Treatment M
Treatment M
Treatment F
Treatment F
Control M
Control M
Control F
Control F
Control F
Control F
;
run;
proc freq data=test;
table gender*class / nopercent norow out=freq_gender;
run;
I'd like to produce the following table with nested header:
Control | Treatment | |||
Gender | Frequency | Col Pct | Frequency | Col Pct |
Female | 4 | 66.67 | 2 | 50.00 |
Male | 2 | 33.33 | 2 | 50.00 |
Is that possible in proc freq or do I need to use other procedures?
I'd probably recommend PROC TABULATE. More control over what is displayed in that procedure.
I'd probably recommend PROC TABULATE. More control over what is displayed in that procedure.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.