We use different statistics for continuous and category variables, respectively. We have to use two table statement. Is there any way to show them in one table? Thanks.
Code:
proc tabulate data = d202_raw;
title 'Summary of patient characterisitcs';
class AF gender smoker CHF DM Stroke Hypertension HFstage hypoalbuminemia RIFLE
indication1 CYP2C9 VKORC1
Amiodarone Statin Antiplatelets
;
var ageY wt bsa followUp
alb1 alb2 alb3 alb4 alb5
;
table
ageY
wt
bsa
followUp
alb1
alb2
alb3
alb4
alb5
, AF = 'Atrial fibrillation' * (N Mean STD Q1 Q3)
all = 'Overall' * (N Mean STD Q1 Q3);
table
gender
smoker
CHF
DM
Stroke
Hypertension
HFstage
hypoalbuminemia
RIFLE
indication1
CYP2C9
VKORC1
Amiodarone
Statin
Antiplatelets
, AF = 'Atrial fibrillation' * (N colpctn = '%')
all = 'Overall' * (N colpctn = '%')
;
run;
You want to know if you can form a table statement that generates one set of statistics for some rows (class vars) and other statistics for other rows (continuous vars).
The answer is no.
But the greater question is why? Are you trying to generate a specific sequence of variables in your report?
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.