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 (November 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 19 Nov 2004 09:21:03 -0500
Reply-To:     Jim Groeneveld <jim1stat@YAHOO.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <jim1stat@YAHOO.CO.UK>
Subject:      Re: What's the easy way to refer to the member variables in a
Comments: To: Fred Zhang <ieaggie2002@GMAIL.COM>

Hi Fred,

m and n should be equal or you can't use all of them in correlation analysis, which is pairwise. You should also have some ID variable in both datasets, else you can't merge them correctly. An example:

DATA Both; MERGE Dataset1 (KEEP=ID Var1-4) Dataset2 (KEEP=ID Var2_4); BY ID; RUN;

and use dataset Both in the ocrrelation analysis.

Regards - Jim. -- Y. (Jim) Groeneveld, MSc., Biostatistician, Science Team Vitatron B.V., Meander 1051, 6825 MJ Arnhem P.O.Box 5227, 6802 EE Arnhem, the Netherlands Tel: +31/0 26 376 7365, Fax: +31/0 26 376 7305 (replace _AT_ by AT sign),

My computer multi-boots OS's, each of them adapting the DST twice a year.

[common disclaimer]

On Fri, 19 Nov 2004 08:10:33 -0500, Fred <ieaggie2002@GMAIL.COM> wrote:

>Hi, all > >I was always confused and trapped in the array operations in SAS. > >Suppose I have two big big data sets, each contains more that 20 >different variables. >Therefore, it is impossible to explicitly write their exact names in code.Rather >we have to refer to each distinct variable by using its index or order >in the data set. >Data set 1 named D1: >var1_1 var1_2 var1_3 var1_4 .... var1_m >.... >... > >Data se 2 named D2: >var2_1 var2_2 var2_3 var2_4 .... var2_n >.... >..... > >For example, I need to do correlation between one variable in D1 with >another specific one in D2. >That is, to compute correlation(var1_i, var2_j), s1<=i<=m, s1+1 <= j <= n. >Note: The number m and n are not pre-defined. s1 is a fixed number. > >Anyone has similar experience on matrix referring problem like the above? > >Thanks a lot in advance. > >Fred

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