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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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