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.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →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.