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;

 


 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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