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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 1 reply
  • 219 views
  • 0 likes
  • 2 in conversation