BookmarkSubscribeRSS Feed
ssryg
Calcite | Level 5

I want to add a row at the bottom of this table with the mean for stop_length for all cases, so that it is easy to compare the overall mean with the means by class. How can I add a final summary row to this table?

 


proc means data=DATA stackodsoutput mean median mode stddev min max range ;
vars Stop_Length;
class TSOutcomeofStop;
title "Title";
run;

 

1 REPLY 1
Reeza
Super User

Do you want a table or displayed output?

 

Here's some examples of both:

 

proc means data=sashelp.cars stackodsoutput mean median mode stddev min max range ;
    ways 0 1;
	vars length;
	class make;
	title "Title";
	ods output summary = want1;
run;

proc print data=want1;
run; 

proc tabulate data=sashelp.cars out=want2;
class make;
var length;

table (all = 'Overall' make='') , length*(mean median mode stddev min max range);
run;

proc print data=want2;
run;

 


@ssryg wrote:

I want to add a row at the bottom of this table with the mean for stop_length for all cases, so that it is easy to compare the overall mean with the means by class. How can I add a final summary row to this table?

 


proc means data=DATA stackodsoutput mean median mode stddev min max range ;
vars Stop_Length;
class TSOutcomeofStop;
title "Title";
run;

 


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 565 views
  • 0 likes
  • 2 in conversation