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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.