Its is possible extract "means "and "std" from another data step and make it a solid value than I can paste in PROC STANDARD? Here is my unfinished example
data what_i_have;
input x1 x2 x3;
cards;
1 2 3
4 5 6
7 8 9
;
run;
proc means data=what_i_have mean std;
output out=mean_x1 mean= std= /autoname;
run;
proc standard data=what_i_have out=what_i_want mean = "here i want paste my mean from choosen variable" std= "here i want paste my std ";
var x1 */ I want here iterate through every variable */;
run;
The best
This is possible to do the way you describe. However, I wonder if there is a better way. Is your goal to standardize data, i.e. subtract the mean of a variable and divide by the variable's standard deviation? If so, there are better ways.
For example, see the article 4 ways to standardize data in SAS by @Rick_SAS .
Here's one way.
https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas
PROC STDIZE will also standardize variables and calculate the mean/standard deviation as needed.
@x3d1m4 wrote:
Its is possible extract "means "and "std" from another data step and make it a solid value than I can paste in PROC STANDARD? Here is my unfinished example
data what_i_have; input x1 x2 x3; cards; 1 2 3 4 5 6 7 8 9 ; run; proc means data=what_i_have mean std; output out=mean_x1 mean= std= /autoname; run; proc standard data=what_i_have out=what_i_want mean = "here i want paste my mean from choosen variable" std= "here i want paste my std "; var x1 */ I want here iterate through every variable */; run;
The best
@x3d1m4 wrote:
Its is possible extract "means "and "std" from another data step and make it a solid value than I can paste in PROC STANDARD? Here is my unfinished example
data what_i_have; input x1 x2 x3; cards; 1 2 3 4 5 6 7 8 9 ; run; proc means data=what_i_have mean std; output out=mean_x1 mean= std= /autoname; run; proc standard data=what_i_have out=what_i_want mean = "here i want paste my mean from choosen variable" std= "here i want paste my std "; var x1 */ I want here iterate through every variable */; run;
PROC STDIZE will do this for you without the PROC MEANS step and without you having to paste anything, and it will do it for every variable with one call to the PROC.
proc stdize data=what_i_have method=std out=what_i_want;
var x1 x2 x3;
run;
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 how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.