BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sas_Geek
Calcite | Level 5

data test;

     input group $ number;

     datalines;

     A 1

     A 2

     A 3

     B 4

     B 5

     B 6

     ;

     run;

ods html file = '..\test.xls';

     

proc tabulate;

     var number;

     class group;

     tables number*(n mean median), group;

     run;

proc tabulate;

     var number;

     class group;

     tables number*(n='' mean='' median=''), group;

     run;

ods html close;

The first proc tabulate inserts a column in Excel file with the name of the statistic (m mean median), while the second proc tabulate blanks those names, however, the column still remains. Is there a way to remove that column from the output?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  When you blank out statistic names in the row dimension with TABULATE, you can use ROW=FLOAT to remove/suppress the empty row header area for the statistic names:

tables number*(n='' mean='' median=''), group /row=float;

...if you add this table option to your 2nd TABULATE step, that should get rid of the statistic names. However, I would expect that the people using the report might find it confusing to know which row is the N, which the MEAN and which the MEDIAN if you suppress that information.

  The documentation example that explains the behavior is here: Base SAS(R) 9.4 Procedures Guide, Third Edition, but you will see that they are only suppressing 1 statistic name (SUM), which is the ONLY statistic used in the example.

  Here's a Tech Support note about it: 22751 - I am blanking out a statistic in my row dimension and the label is blank but the space has r... and here's another: 498 - The ROW=FLOAT option has no effect on the files created with ODS HTML,PRINTER or RTF (this behavior changed in SAS 9.1).

cynthia

View solution in original post

5 REPLIES 5
ballardw
Super User

You may want to provide what you want the table to look like. To suppress a column then don't ask for it. If you ask for N as a statistic you will get a column for it, if you don't want the column remove the statistic.

Cynthia_sas
SAS Super FREQ

Hi:

  When you blank out statistic names in the row dimension with TABULATE, you can use ROW=FLOAT to remove/suppress the empty row header area for the statistic names:

tables number*(n='' mean='' median=''), group /row=float;

...if you add this table option to your 2nd TABULATE step, that should get rid of the statistic names. However, I would expect that the people using the report might find it confusing to know which row is the N, which the MEAN and which the MEDIAN if you suppress that information.

  The documentation example that explains the behavior is here: Base SAS(R) 9.4 Procedures Guide, Third Edition, but you will see that they are only suppressing 1 statistic name (SUM), which is the ONLY statistic used in the example.

  Here's a Tech Support note about it: 22751 - I am blanking out a statistic in my row dimension and the label is blank but the space has r... and here's another: 498 - The ROW=FLOAT option has no effect on the files created with ODS HTML,PRINTER or RTF (this behavior changed in SAS 9.1).

cynthia

Sas_Geek
Calcite | Level 5

Thanks, Cynthia! This is exactly what I was looking for.

Your doubt is valid, but the information regarding which row is N, Mean, etc. will be included within the Excel file that will be Output.

Sas_Geek
Calcite | Level 5

Is it possible to get an output like this?

group
AB
number
N33
Mean25
Median25

Instead of following two:

group
AB
numberN33
Mean25
Median2

5

OR

group
AB
number33
25
25

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
  • 5 replies
  • 4783 views
  • 0 likes
  • 4 in conversation