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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.