BookmarkSubscribeRSS Feed
xliu1
Quartz | Level 8

I have a table in SAS like the one in screen shot. I need to add one more column to show the percentage of sub-total for each category. For example, class_type='1-LOWER UG' and Campus='1-TPA', the percentage (using CY column) would be 7368/42008 = 17.5%; class_type='2-UPPER UG' and Campus='1-TPA', the percentage (using CY column) would be 22801/42008 = 54.3%.... Is there a simple way to do this? Will appreciate any help! Thanks!

 

xliu1_0-1615236532359.png

 

2 REPLIES 2
Reeza
Super User
How did you originally calculate your stats?
If you used PROC MEANS you have the ability to specify the levels of results, including sub groups so backing up and changing something in your prior process is the most efficient solution most likely.
PaigeMiller
Diamond | Level 26

Please provide data as SAS data step code, following these instructions. This needs to be done 100% of the time, so we actually have data that we can work with. Screen captures are not acceptable and not usable in developing code.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1006 views
  • 0 likes
  • 3 in conversation