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.
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.