BookmarkSubscribeRSS Feed
Deepai
Calcite | Level 5

i have 400 clusters, each cluster has around 50 people. i want to get the proportion of diabetes people in each cluster and create new variable naming proportion of Diabetes in the same dataset can someone help me with this

4 REPLIES 4
ed_sas_member
Meteorite | Level 14

Hi @Deepai 

You can run a PROC FREQ to do this.

Assuming you have a dummy variable indicating the status of the patient regarding diabetes:

proc freq data=have noprint;
   tables flag * cluster_id / out=want;
run;
Deepai
Calcite | Level 5
Thank yiu
ed_sas_member
Meteorite | Level 14
Thank you @Deepai!
Could you please mark the topic as answered and close it? Thank you.
Deepai
Calcite | Level 5

thank you for the information, I got it but in a separate dataset

 

However i am trying to get the proportion of diabetes by clusters in the same dataset. 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1879 views
  • 0 likes
  • 2 in conversation