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 = "(%)";
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.
PROC TABULATE DATA=sashelp.prdsale ;
CLASS region product year ;
VAR actual ;
TABLE (region product)*(SUM="N"*F=12. PCTSUM="%"*F=12.2),