Trying to create a table like this:
| Region | Gender | Number |
| A | f | 2 |
| m | 2 | |
| B | f | 2 |
| m | 2 | |
| C | f | 2 |
| m | 2 | |
| Total | f | 6 |
| m | 6 |
Have tried this, but not getting the total by gender (last two rows in the table)
proc report data=final style(summary)=header;
column region gender n;
define region/group style (column)=Header;
define gender/group;
define n / 'Total';
break after region / summarize ;
rbreak after/summarize;
run;
Thanks
Hi:
PROC REPORT will not give you a total line like you want without manipulating the data in advance or perhaps using a more advanced COMPUTE block. But PROC TABULATE will easily do what you want:
Hope this helps,
Cynthia
Hi:
PROC REPORT will not give you a total line like you want without manipulating the data in advance or perhaps using a more advanced COMPUTE block. But PROC TABULATE will easily do what you want:
Hope this helps,
Cynthia
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.