Date: Wed, 30 Nov 2005 14:31:05 -0500
Reply-To: Zach Peery <zpeery@NATURE.BERKELEY.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Zach Peery <zpeery@NATURE.BERKELEY.EDU>
Subject: bootstrapping (genetic data)
Hi All,
I have what I think is a pretty straight forward question about
bootstrapping genetic data. I would like to randomly select genes from
individuals (with replacement) from an original dataset and make new
individuals with those genes placed into a new dataset. Easy (and done in
the sas statements below), but the catch is that my data set has more than
one gene. The law of independent segregation says that different genes
must be independent for a given newly generated (born) individual. In
other words the gene 2 for new individual 1 at should be independent of
gene 1 at that individual.
Does anyone feel like taking a stab at the code I below, which randomly
selects individuals, but where the three genes are not independent.
*Set number of orginal and randomly generated indidviduals;
%let nOriginalIndividuals = 4; *equals number of rows in cards statement;
%let nRandomIndividuals = 6;
data OriginalIndividuals;
input individual gene1 $ gene2 $ gene3 $; *note the actual data set has 30
genes;
cards;
1 28 15 65
2 16 29 67
3 34 43 73
4 32 19 81
;
*randomly select individuals from original individuals;
data RandomIndividuals;
do nRandomIndividuals = 1 to &nRandomIndividuals;
pt = round(ranuni(0)*(&nOriginalIndividuals));
set OriginalIndividuals point = pt;
output;
end;
stop;
run;