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 your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.