Please help me out. I am trying to group Age variable say <10, 11-20, 30-40 and 40> and compute the number of occurence that falls within the range but I have been having challenge doing it. I am using the SAS studio
You can do a frequency of AGE using proc freq. But the problem is that it will tabulate individual age values, rather than the age groups of interest to you.
You could create a new variable, AGE_GROUP, calculated from AGE, and then get a frequency table of the new variable. Or I recommend you create a format for AGE, which establishes age groups. And then tell PROC FREQ to do a frequency of AGE using the format you have defined.
Have you set up the proc freq (without grouping) yet? I recommend you show that code, and then we can be more useful in helping you.
You can do a frequency of AGE using proc freq. But the problem is that it will tabulate individual age values, rather than the age groups of interest to you.
You could create a new variable, AGE_GROUP, calculated from AGE, and then get a frequency table of the new variable. Or I recommend you create a format for AGE, which establishes age groups. And then tell PROC FREQ to do a frequency of AGE using the format you have defined.
Have you set up the proc freq (without grouping) yet? I recommend you show that code, and then we can be more useful in helping you.
Thank you for the suggestion. I created AGE_GROUP, calculated from AGE, and then got a frequency table of the new variable.
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 lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.