BookmarkSubscribeRSS Feed
GPatel
Pyrite | Level 9

Is it possible to display row and column percentages next to cell values using Proc Tabulate?

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  It depends on your data and what you mean by "next to cell values". In the program below, the ROWPCTN and COLPCTN are "next to" the count (N) for each crossing of AGE and SEX.

 

  You should be able to run this program, since it uses SASHELP.CLASS. If you have specific PROC TABULATE questions, it is usually helpful if you show a sample of your data and the code that you have tried. Or, paste an example of what you want your results to look like, with a sample of your data.

  cynthia

ods _all_ close;

title; footnote;

options missing=' ';

proc format;

  picture pctf low-high='009.99%';

run;

   

ods html file='c:\temp\tab_pct.html' style=sasweb;

 

proc tabulate data=sashelp.class f=pctf.;

  class age sex;

  table age all,

        sex*(n*f=3. rowpctn colpctn) all*(n*f=3. rowpctn colpctn);

  keylabel all='Overall';

run;

 

ods html close;

GPatel
Pyrite | Level 9

Cynthia,

Thanks for your propmt and perfect solution. It is what I was looking for.

Girish Patel

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
  • 2 replies
  • 726 views
  • 0 likes
  • 2 in conversation