BookmarkSubscribeRSS Feed
deleted_user
Not applicable
HI all,
This is my data set..........

STAGE X Y Z TOTAL
A 1 2 2 5
B 3 6 9 18
C 1 2 5 8
TOTAL 5 10 16 31

By using rbreak in proc report we can get this 'TOTAL' row means we can summarize the data but instead of total i want percentage of data values with respect to total and with % sign along with it..Like..........

TOTAL 16.1% 32.2% 51.6% 100%

SO IS IT POSSIBLE?

Thanks for ur help...........
4 REPLIES 4
ChrisNZ
Tourmaline | Level 20
proc report is not my cup of tea, but since no one replied, here is my ugly solution.

proc format ;
value weight 0-1=[percent.];

proc report data=sashelp.class;
define sex /group;
define age /across ;
define weight/sum format=weight6.;
column sex age,weight ;
rbreak after/summarize;
compute after;
TOTAL=sum(_C2_, _C3_ , _C4_ , _C5_ , _C6_, _C7_ );
_C2_=_C2_/TOTAL;
_C3_=_C3_/TOTAL;
_C4_=_C4_/TOTAL;
_C5_=_C5_/TOTAL;
_C6_=_C6_/TOTAL;
_C7_=_C7_/TOTAL;
endcomp;
run;
quit;
Cynthia_sas
SAS Super FREQ
Hi:
This person posted in multiple forums. There were 2 answers posted in a different forum location.
cynthia
deleted_user
Not applicable
Thanks a lot Chris.......
and thanks to u too cynthia..
and no one replied on the previous forum thats why i have posted it again in different forum and also the reply which i got in that that was wrong..
bt the reply in this is working exactly..
thanks again Chris...
ChrisNZ
Tourmaline | Level 20
No worries, Mittal. Sorry Cynthia, I didn't see the other post.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 665 views
  • 0 likes
  • 3 in conversation