Dear all,
data have;
input id sex$ race$ age agecat$;
datalines;
01 F W 66 60-70
02 F B 87 80-90
03 M W 63 60-70
04 M A 79 70-80
05 M W 75 70-80
06 M U 72 70-80
07 F W 66 60-70
08 F B 87 80-90
09 M W 63 60-70
10 M A 79 70-80
11 M W 75 70-80
12 M U 72 70-80
;
Descriptives | Overall Cohort | Males | Females | |||
Age | ||||||
Mean | Standard Deviation | Mean | Standard Deviation | Mean | Standard Deviation | |
Minimum | Maximum | Minimum | Maximum | Minimum | Maximum | |
25% IQR | 75% IQR | 25% IQR | 75% IQR | 25% IQR | 75% IQR | |
Age Group | ||||||
60-70 years | N | % | N | % | N | % |
70-80 years | N | % | N | % | N | % |
80-90 years | N | % | N | % | N | % |
A previous post provided a "close" Proc Tabulate solution but apparently having two tables isn't quite what the OP wants.
I suggested an RWI approach may be possible but haven't the time or inclination at this point to try to cobble something that non-standard together as it was reminding me entirely too much of the programs with 400 PUT statements to put a dozen or so "tables" on a single page from many years ago.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.