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
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;
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.