02-18-2012 10:05 AM
Hi, I thought I'd change the discussion a little... when I run this code I get "merged" cells in the first row.. how can I get rid of the merged feature. Se diagram below of what I get, and my proc tabulate code:
This is the code I use from a Proc Tabulate:
TABLE Transaction_Type*CI1_T,N pctn<CI1_T all> /rts=35;
02-18-2012 12:03 PM
That "merged cell" is a side effect of how TABULATE operates. The big empty "box" at the intersection of your row headers (TRANSACTION_TYPE and CI1_T) and your column headers (N and PCTN) causes the row headers to be placed in the first "row", thus causing what you show. Here's an interesting blog post about how this is one reason why folks switch over to PROC REPORT.
With only 1 variable in the ROW dimension, you can put a variable value into the big empty box. Or, you can put a string of your own choosing up in the BOX area. In either of those cases, you can suppress the header for TRANSACTION_TYPE and CI1_T and it would make the whole row go away. (I took out the RTS= option because your output looks like PDF and PDF essentially ignores the RTS option.
TABLE Transaction_Type=' '*CI1_T=' ',N pctn<CI1_T all> /row=float
box='Transaction and CI1_T';
02-18-2012 08:47 PM
Thanks Cynthia, worked perfectly... would you know how I can make the percent not be multiplied by 100. and show as 0.352 rather than 35.2 ? Thanks
02-20-2012 12:37 AM
I posted a response to the latter question under a second thread that was started on the topic of podarum's second question. A solution, that worked, was to created and apply a format, namely:
format label 4.3;
retain fmtname 'fraction' type 'n';
do start=0 to 100 by .1;
proc format cntlin=fractions;
02-20-2012 12:39 AM
You need another format to display it.
proc format; picture per low-high='9.99' (mult=1); run; proc tabulate data=sashelp.class ; class sex age; table sex=''*(age='' all),n pctn*format=per. ; run;