Date: Thu, 2 Sep 1999 23:53:48 -0400
Reply-To: HyeRyung Lee <hrlee@WORLDNET.ATT.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: HyeRyung Lee <hrlee@WORLDNET.ATT.NET>
Content-Type: text/plain; charset="euc-kr"
hello, could anyone solve this question for me?
I have a dataset which has visits from 0 to 5. make a new data sets which is
averaged from visit 0 and visit 2. Each has 20 variables with numeric
values. Is there any simple way to average the values of variable at one
step?
For example,
data one two;
set a.original;
if visit=0 output one;
if visit=1 output two;
run;
data one;
set one;
rename var1=one_var1;
rename var2=one_var2;
.
.
.
proc sort;by id;
run;
data two;
set two;
rename var1=two_var1;
rename var2=two_var2;
.
.
.
proc sort;by id;
run;
data average;
merge one two;
by id;
run;
data average;
set average;
avevar1=mean(one_var1,two_var1);
avevar2=mean(one_var2,two_var2);
.
.
.
run;
Could anyone give me a smart answer except for this dull way?
Thank you.
HR