Help using Base SAS procedures

Transpose proc means results

Reply
Super Contributor
Posts: 400

Transpose proc means results

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
Respected Advisor
Posts: 3,799

Re: Transpose proc means results

Posted in reply to jerry898969
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]
Super Contributor
Posts: 400

Re: Transpose proc means results

Posted in reply to data_null__
_null_,

Thank you so much for the help.

Jerry
Ask a Question
Discussion stats
  • 2 replies
  • 2037 views
  • 1 like
  • 2 in conversation