LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page