BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bmozdemir
Calcite | Level 5

Hello
I'd like to get some descriptive statistics and report them similar to the example below. For example we can take the data set cars. How should I list the individual parametes first and then the descriptives right after them in the same column? Proc report?

-x1x2x3
-157
-289
-3104
-435
N444
mean2.56.56.25
std.1.293.112.22
min134
median2.56.56
max4109
%CV51.647.835.5
geo. mean2.25.96.0

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

None of the standard procs will do that by default, you'll have to create your own data and then use proc print or report to display it.

Here's a sample, but it doesn't create the geomean. 

data have;

input x1 x2 x3;

cards;

1 5 7

2 8 9

3 10 4

4 3 5

;

run;

proc means data=have stackods n mean min std median max cv;

var x1 x2 x3;

ods output summary=stats;

run;

proc transpose data=stats out=stats2;

id variable;

run;

data want;

set have (in=a) stats2(in=b);

if a then _NAME_='RAW';

drop _label_;

run;

View solution in original post

2 REPLIES 2
Reeza
Super User

None of the standard procs will do that by default, you'll have to create your own data and then use proc print or report to display it.

Here's a sample, but it doesn't create the geomean. 

data have;

input x1 x2 x3;

cards;

1 5 7

2 8 9

3 10 4

4 3 5

;

run;

proc means data=have stackods n mean min std median max cv;

var x1 x2 x3;

ods output summary=stats;

run;

proc transpose data=stats out=stats2;

id variable;

run;

data want;

set have (in=a) stats2(in=b);

if a then _NAME_='RAW';

drop _label_;

run;

bmozdemir
Calcite | Level 5

Thank you very much Reeza. Great solution!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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