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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 4192 views
  • 1 like
  • 3 in conversation