At the following code i don't want to change columns name when i use to output option .How can i prevent this. And i wonder if i need to use more VAR variable im Mean procedure how can i do it. If i do it, is it possible to make sort this values on new table ?
Thank you.
PROC MEANS DATA=WORK.X1 noprint
FW=12
PRINTALLTYPES
CHARTYPE
QMETHOD=OS
VARDEF=DF
MEAN
STD
MODE
P10
P90 ;
VAR F2;
ods output summary=sample;
RUN;
data newStep;
set work.sample;
Slope=2.95/(((F2_P90-F2_Mode)*2+F2_Mode)-(F2_Mode));
Median=((F2_P90-F2_Mode)*2+F2_Mode)-((F2_Mode)-(F2_P90-F2_Mode)*2)/2;
run;
you can use more var variables in proc means by just mentioning the numeric variable names in the var statement separated by space. And in the output out statement , use the autoname option so that the descriptic statistics produced will represent the respective statistics concatenated with variable names.Try the code something like below
proc means data=have mean std min max;
var var1 var2;
output out=want mean= std= min= max= / autoname;
run;
Thanks,
Jag
Thanks a lot but how can i prevent first two column and it brings just one raw in output?
proc means data=SampleData mean std mode P10 P90
FW=12
PRINTALLTYPES
CHARTYPE
QMETHOD=OS
VARDEF=DF
MEAN
STD
MODE
P10
P90
;
var Q1 Q2;
output out=want mean=mean std=std mode=mode P10=P10 P90=P90;
run;
data newsample;
set work.sample;
Slope=2.95/(((P90-Mode)*2+Mode)-(Mode));
Median=((P90-Mode)*2+Mode)-((Mode)-(P90-Mode)*2)/2;
run;
I need other columns here ?
&
If i need to add thousands VAR in the proc means procedure how can i made it ?
Thank you.
I'll take thousands column and I want to see output like this.
.
You can get all numeric variables on the VAR statement using a special list: _numeric_
as in
VAR _numeric_;
Or NO VAR statement at all will summarize all numeric variables in the data.
Thanks again but I tried it and it didn't work.
I tried again and i made it, thank you. Now my last question is how can i add thousands columns on VAR expression from another data set.
proc means data=WORK.sample STACKODS
FW=12
PRINTALLTYPES
CHARTYPE
QMETHOD=OS
VARDEF=DF
MEAN
STD
MODE
P10
P90 ;
var Q1 Q2 Q3;
ods output summary=stacked;
run;
/*This code gives multiple row output*/
%let number=????
proc means data=WORK.sample STACKODS
FW=12
PRINTALLTYPES
CHARTYPE
QMETHOD=OS
VARDEF=DF
MEAN
STD
MODE
P10
P90 ;
var Q1 Q2 Q3........Q10000;
ods output summary=stacked;
run;
Thanks a lot. I made it. 🙂
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.