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;
Thanks
Hi:
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.
http://blogs.sas.com/content/sasdummy/2010/10/22/proc-report-versus-tabulate-two-sas-heavyweights/
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.
cynthia
TABLE Transaction_Type=' '*CI1_T=' ',N pctn<CI1_T all> /row=float
box='Transaction and CI1_T';
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
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:
data fractions;
format label 4.3;
retain fmtname 'fraction' type 'n';
do start=0 to 100 by .1;
end=start+0.0999999999;
label=start/100;
output;
end;
run;
proc format cntlin=fractions;
run;
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;
Ksharp
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.