BookmarkSubscribeRSS Feed
gabon
Calcite | Level 5

Hello,

I have a very simple question, is it possible to use proc freq (for crosstabulation) in a way, that it has included ONLY colpercent and totalpercent in the output? I mean, without overall percent in the cells. Because if I use nopercent option it removes also totalpercent in total rows and columns(image2), but if I include percent, then in every cell I have two numbers - colpercent and percent(image1). I basically want to have only one number in cells - colpercent and total percent in totals(something like image3, total rows are not important, but the total column is). Is it possible with proc freq? Or should I use proc tabulate ?

Thanks Smiley Happy


output2.jpgoutput1.jpgoutput3.jpg
4 REPLIES 4
Reeza
Super User

Use the NOROW option in Proc freq to suppress the row percents.

gabon
Calcite | Level 5

I actually use that option.. these additional percents are not row percents, they are percentages of the total sum. I can remove them only by nopercent option, but then I lose totals. So it seems impossible to set as I want. But I guess I will have to explore that proc tabulate so I can solve all the problems with unflexible proc freq.

Cynthia_sas
SAS Super FREQ


Hi:

   I recommend PROC TABULATE if you want a crosstabular report, but want to have only percents and not cum percents and not totals. Here's an example using SASHELP.HEART.

Cynthia

ods html file='c:\temp\colpercent.html';

proc tabulate data=sashelp.heart;
  class chol_status sex;
  table chol_status all,
        all*colpctn sex*colpctn;
  keylabel all='Total'
           colpctn = 'Col Pct';
  keyword all / style={vjust=b};
run;
ods html close;

gabon
Calcite | Level 5

Thanks, it looks like it offers much more customization than proc freq, I will start using it more.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1130 views
  • 3 likes
  • 3 in conversation