Hi all,
I'm struggling to make a certain type of table I've been asked for. In essence, I need a crosstab table of all of my categorical variables so I will know cell counts. So, for example, if I had race, sex, and eye color then I will need a table of Race*sex*eyecolor by race*sex*eyecolor. So if I needed to know how many white females have green eyes I will be able to have one cell that gives the N of that specific category. I can't for the life of me figure this out. The best advice I've had so far is to use a PROC FREQ procedure, but this generates many tables for each possibility, and I need one big table.
proc freq data=mn1;
tables iedtotal_50*iedpreed_50*iededs_50*school_2*bc_1*pb_method*wm_cog_admin/ nopercent nocol norow;
run;
Could anyone help me with this? I'm sure someone out there must know how to do this. Appreciate it.
proc freq data=mn1;
tables iedtotal_50*iedpreed_50*iededs_50*school_2*bc_1*pb_method*wm_cog_admin/ out=want list nopercent nocol norow;
run;
Try that, the LIST to create a list table instead and an OUT to output a data set with the data instead of a report.
@TMSmith wrote:
Hi all,
I'm struggling to make a certain type of table I've been asked for. In essence, I need a crosstab table of all of my categorical variables so I will know cell counts. So, for example, if I had race, sex, and eye color then I will need a table of Race*sex*eyecolor by race*sex*eyecolor. So if I needed to know how many white females have green eyes I will be able to have one cell that gives the N of that specific category. I can't for the life of me figure this out. The best advice I've had so far is to use a PROC FREQ procedure, but this generates many tables for each possibility, and I need one big table.
proc freq data=mn1; tables iedtotal_50*iedpreed_50*iededs_50*school_2*bc_1*pb_method*wm_cog_admin/ nopercent nocol norow; run;
Could anyone help me with this? I'm sure someone out there must know how to do this. Appreciate it.
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.