- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc sql;
SELECT AVG(Variable)
INTO: M
FROM Dataset_Name;
SELECT STD(Variable)
INTO: S
FROM Dataset_Name;
QUIT;
RUN;
----------------------------------------- CREATE NEW VARIABLES-----------------------------
DATA what_i_have;
SET what_i_have;
M=&M;
S=&S;
RUN;
------------------------------------PUT INTO PROC STANDARD----------------------------------
proc standard data=what_i_have out=what_i_want mean = M std= S;
var x1 */ I want here iterate through every variable */;
run;