Hello, my question regarding proc tabulate is how to get the categorical variable name to appear to the left of the categorical levels of the variable, particularly in Excel output.
The categorical variable name is Gender and the categorical levels are Male and Female.
For example, my current proc tabulate output in Excel looks like this (please ignore color scheme):
I would like the output in Excel to look like this below (please ignore the color scheme):
Are there any options, statements etc. for proc tabulate to change to that kind of output? Are there ways to do this in ODS Excel?
Please let me know if there's anything else I need to provide.
Thanks in advance.
data have;
set sashelp.class;
dummy='Gender';
run;
proc tabulate data=have;
class dummy sex age;
table dummy=' '*sex=' ',age=' '*n=' ';
run;
data have;
set sashelp.class;
dummy='Gender';
run;
proc tabulate data=have;
class dummy sex age;
table dummy=' '*sex=' ',age=' '*n=' ';
run;
@Ksharp Your F and your M look really strange! 😉
@Ksharp Yes. I was being facetious 🙂
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.