The SAS Output Delivery System and reporting techniques

Table with "n" and "%" in separate rows?

Reply
N/A
Posts: 0

Table with "n" and "%" in separate rows?

I am trying to create a table that has the "n" and "%" in separate rows, so that the percentages can be read from the table straight across, instead of having the "n" and "%" columns next to each other. Here is my current code - any ideas? Thanks in advance! (Q1 is a 1-5 scale.)

proc tabulate data=mvr.ready_08_6Jun(where=(wave ge 230)) format=9.1 noseps formchar(1,8,2,3,4,5,6,7,9,10,11)='||----|+|---';
title 'Table 1a';
format wave wave. q1 sat. total total.;
class wave q1 total;
table (q1="OVERALL SATISFACTION" total=' '),
wave*(pctn*f=p8r6.0 N*f=4.0)/rts = 35
box="Table 1a. OVERALL SATISFACTION" misstext=' ';
keylabel pctn = "(%)";
run;
Super Contributor
Posts: 260

Re: Table with "n" and "%" in separate rows?

Hello.

In your example, what you need to do is move the *(PCTN ... F=4.0) part BEFORE the comma, meaning that you want separate LINES instead of COLUMNS (what is after comma defines columns).
I've tested this little code, slightly different from yours, but showing the idea.
[pre]
PROC TABULATE DATA=sashelp.prdsale ;
CLASS region product year ;
VAR actual ;
TABLE (region product)*(SUM="N"*F=12. PCTSUM="%"*F=12.2),
actual=""*year="" ;
RUN ;
[/pre]
Regards,
Olivier
N/A
Posts: 0

Re: Table with "n" and "%" in separate rows?

Thank you so much, Olivier! That is exactly what I needed to know!
Ask a Question
Discussion stats
  • 2 replies
  • 111 views
  • 0 likes
  • 2 in conversation