Hi Everyone I have come across an issue that I was hoping someone could help me solve. I have a data set with 120 observations. I would like to see how many times various combinations of five variables present themselves within the data. According to my calculations there are 31 possible unique combinations of the 5 variables. What I would like to see is how many times each of these 31 combinations are present within these 120 observations. A table of the possible combinations is listed with the 5 variables represented as A, B, C, D, and E. Any help would be greatly appreciated!
This should do it:
proc freq data=have;
tables a * b * c * d * e / missing list;
run;
The number of combinations of values could be much larger depending on what values your variables take on. But you'll see that soon enough.
Good luck.
This should do it:
proc freq data=have;
tables a * b * c * d * e / missing list;
run;
The number of combinations of values could be much larger depending on what values your variables take on. But you'll see that soon enough.
Good luck.
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.