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

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 544 views
  • 0 likes
  • 2 in conversation