|Date: ||Fri, 12 Mar 2010 04:31:30 -0500|
|Reply-To: ||Jim Groeneveld <jim.1stat@YAHOO.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Jim Groeneveld <jim.1stat@YAHOO.COM>|
|Subject: ||Re: Using character variales as continuous variables|
|Content-Type: ||text/plain; charset=ISO-8859-1|
Maybe my macro aRecodeN.sas may be applicable to you as in the example:
FILENAME AutoCall "C:\Jim\AutoCall.sas";
OPTIONS MAUTOSOURCE SASAUTOS = (AutoCall);
%aRecodeN (SourceDs=Inputds, TargetDs=OutputDs,
VarList=<list of 50 SNP variables>,
OldVlist=AA CC GG TT AC AG CT,
NewVlist= 0 0 0 0 1 1 1 /* as desired */)
Download it from http://jim.groeneveld.eu.tf/software/SASmacro/
Regards - Jim.
Jim Groeneveld, Netherlands
Statistician, SAS consultant
My computer sorrily regrets to communicate our nogo to SGF-2010.
On Wed, 10 Mar 2010 15:53:02 -0800, Lance Smith <medicaltrial@GMAIL.COM> wrote:
>I have a database of 50 SNP variables. Each SNP variable has 3 levels
>let�s say AA, AG, GG. The levels vary with different SNPs, so another
>one may be CC CT and TT and still another may be AA AC and CC.
>I also have levels of four markers that are on a continuous scale.
>I need to do univariate linear regression to predict the level of
>biomarkers using wach SNP seperately.
>Thus I need to do 50*4 = 200 univariate linear regressions.
>The SNPs need to be recoded to 0,1,2 for the regression as we want to
>treat them as a continuous variable with the heterozygotes (AG or CT
>or AC) coded as 1.
>Is there a way to efficiently do the recoding to 0,1,2 in SAS without
>having to recode all the 50 SNPs separately? Or is there a way to tell
>SAS to treat them as continuous variables even though they are coded
>as character variables?