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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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