BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

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:

Picture3.jpg

This is the code I use from a Proc Tabulate:

TABLE Transaction_Type*CI1_T,N pctn<CI1_T all> /rts=35;

Thanks

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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';

podarum
Quartz | Level 8

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

art297
Opal | Level 21

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;

Ksharp
Super User

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2420 views
  • 0 likes
  • 4 in conversation