Date: Thu, 12 Sep 1996 18:11:48 EDT
Reply-To: rhoadsm1@WESTATPO.WESTAT.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Mike Rhoads <rhoadsm1@WESTATPO.WESTAT.COM>
Subject: Re: Help with sampling
<<Debbie Kligman asks>>
I have a user who would like to generate a random sample of data from an
underlying data set where the random sample would have a standard deviation
and mean equal to an amount he has already determined (and which differs
from that for the entire population). Does anyone know if this is doable?
We are running SAS 6.11 TS0020.
<<end original question>>
I'm not a statistician, so I probably should keep my mouth shut here. But it
seems that there ought to be some SAS-based solution to the question that Debbie
is asking, regardless of the statistical validity or lack thereof. Assuming
that the variable of interest is called "N", how about (1) using the RANNOR
function to generate a sample of the desired size with mean 0 and variance 1,
(2) "unnormalizing" this random sample based on the desired mean and SD, and (3)
programming a "match" between this random sample (R) and the underlying data set
(U), selecting the "nearest neighbor" in U (based on the value of N) for each
observation in R? The mean and standard deviation of the new data set could
then be rechecked to see how close it comes to what is desired.
(Obviously step 3 involves a lot more programming than 1 and 2!)
Mike Rhoads
Westat
RhoadsM1@Westat.com
|