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
Use the NOROW option in Proc freq to suppress the row percents.
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.
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;
Thanks, it looks like it offers much more customization than proc freq, I will start using it more.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.