Say 'comp' is a class, it has two categories 'a' and 'b'. Under category 'a' there is another class called 'dsc' which has 6 categories. The table will include summary(N, COLPCTN) for category 'b' in 'comp' in one row, and it also include summary for each subgroup in 'dsc' but not the summary for 'a' in 'comp' in following rows. How to do the table operation to achieve this? And is there any way to put N and COLPCTN in the same cell with a parenthesis around COLPCTN?
Something like this?
set SASHELP.PRDSALE(where=(PRODUCT ne 'SOFA'));
value $prodtyp (default=12) 'BED' =' FURNITURE';
proc tabulate order=formated;
class PRODUCT COUNTRY;
table all PRODUCT='', COUNTRY*(n colpctn)*f=comma8.0;
format PRODUCT $prodtyp.;
Only one stat per cell in the tabulate procedure.
Since you only want only one left-hand class column, you must choose between displaying 2 variables in a row
[pre]table all PRODTYPE='' PRODUCT=''[/pre]which requires massaging the data before hand,
or displaying one variable and masking it by using a format, which I did.