BookmarkSubscribeRSS Feed
jerry898969
Pyrite | Level 9
I need helping to transpose my means results. Currently the results come back like this

_stat_ var1 var2 var3
max 100 200 300
mean 400 500 600
min 0 1 0
n 100 100 100
std 1.2 3.4 5.6

I need it to look like this

var1 100 400 0 100 1.2
var2 200 500 1 100 3.4
var3 300 600 0 100 5.6

Thank you for any help
3 REPLIES 3
data_null__
Jade | Level 19
How about...

[pre]
proc means data=sashelp.class noprint;
output out=stats;
run;
proc print;
run;
proc transpose data=stats out=stats2;
by _type_ _freq_;
id _stat_;
run;
proc print;
run;
[/pre]

[pre]
Obs _TYPE_ _FREQ_ _NAME_ N MIN MAX MEAN STD

1 0 19 Age 19 11.0 16 13.316 1.4927
2 0 19 Height 19 51.3 72 62.337 5.1271
3 0 19 Weight 19 50.5 150 100.026 22.7739
[/pre]
jerry898969
Pyrite | Level 9
_null_,

Thank you so much for the help.

Jerry
sfo
Quartz | Level 8 sfo
Quartz | Level 8

Is there a way I can also add Median and Quartile?

 

When I output Proc Means output to a dataset only N Min Max MEAN and STD comes out.

 

In my transpose I also want median and the quartile information.

 

Thanks!

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 4794 views
  • 1 like
  • 3 in conversation