Solved
Contributor
Posts: 41

# horizontal summary table

Hi,

with proc tabulate I have this output :

 mean median Age 30 25 Revenue 2700 2600

and what I want to have is this form :

 Age mean 30 median 25 Revenue mean 2700 median 2600

Is this possible?

Thanks

Accepted Solutions
Solution
‎11-26-2015 12:02 PM
Contributor
Posts: 41

## Re: horizontal summary table

Based on your previous post, I edited the code because I have only numeric variables :

``````PROC TABULATE
DATA=SASHELP.CLASS

;
VAR Height Age;
TABLE
/* ROW Statement */
Height * Mean={LABEL="Mean"} Height={LABEL=""} * Median={LABEL="Median"}
Age * Mean={LABEL="Mean"} Age={LABEL=""} * Median={LABEL="Median"} ,
/* COLUMN statement */
ALL=' ' 		;
;

RUN;``````

And I have the result that I want :

 Height 62.34 62.8 13.32 13

What I looked for is the " , ALL=' '  "

Thanks a lot @Reeza!

All Replies
Super User
Posts: 23,342

## Re: horizontal summary table

Yes, change your table statement. If you post your code, someone can suggest the change from the current code.
Contributor
Posts: 41

## Re: horizontal summary table

OK, it's a simple code:

``````proc tabulate data=have;
var age revenue;
tables
/*line*/
age
revenue,

/*column*/
(mean median);
run;

``````

MK

Super User
Posts: 23,342

## Re: horizontal summary table

What does the following give you:

tables (age revenue)*(mean median);
Contributor
Posts: 41

## Re: horizontal summary table

it gives a vertical summary table like this :

 Age Revenue mean median mean median
Super User
Posts: 23,342

## Re: horizontal summary table

``````PROC TABULATE
DATA=SASHELP.CLASS

;

VAR Height;
CLASS Sex /	ORDER=UNFORMATTED MISSING;
CLASS Age /	ORDER=UNFORMATTED MISSING;
TABLE
/* ROW Statement */
Sex *Age  *(Height * Mean={LABEL="Average"} Height * Median={LABEL="Median"} ),
/* COLUMN statement */
ALL=' ' 		;
;

RUN;``````
Solution
‎11-26-2015 12:02 PM
Contributor
Posts: 41

## Re: horizontal summary table

Based on your previous post, I edited the code because I have only numeric variables :

``````PROC TABULATE
DATA=SASHELP.CLASS

;
VAR Height Age;
TABLE
/* ROW Statement */
Height * Mean={LABEL="Mean"} Height={LABEL=""} * Median={LABEL="Median"}
Age * Mean={LABEL="Mean"} Age={LABEL=""} * Median={LABEL="Median"} ,
/* COLUMN statement */
ALL=' ' 		;
;

RUN;``````

And I have the result that I want :

 Height 62.34 62.8 13.32 13

What I looked for is the " , ALL=' '  "

Thanks a lot @Reeza!

🔒 This topic is solved and locked.