Date: Tue, 11 Apr 2000 19:40:37 -0400
Reply-To: Raynald Levesque <rlevesque@VIDEOTRON.CA>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@VIDEOTRON.CA>
Subject: Re: sampling proportionate to size
Content-type: text/plain; charset=iso-8859-1
Hi!
Here is the solution I posted last month. It is applicable to your problem.
This solution is fine when the number of cases (the number of persons in
your problem) is not too large. Say less than 500,000. More sofisticated
solution would have to be derived for larger populations.
DATA LIST FREE / id numb .
BEGIN DATA
1 5 2 15 3 30
END DATA.
LOOP cnt=1 TO numb.
XSAVE OUTFILE='temp.sav' /KEEP id numb.
END LOOP.
EXECUTE.
GET
FILE='temp.sav'.
COMPUTE draw=UNIFORM(1).
RANK
VARIABLES=draw (A) /RANK /PRINT=NO
/TIES=MEAN .
* In next line, replace 30 by the desired sample size.
SELECT IF (rdraw<=30).
EXECUTE.
HTH
Raynald Levesque rlevesque@videotron.ca
----- Original Message -----
From: Gonzalo Kmaid <gkmaid@INTERNET.COM.UY>
Newsgroups: bit.listserv.spssx-l
To: <SPSSX-L@LISTSERV.UGA.EDU>
Sent: Tuesday, April 11, 2000 4:52 PM
Subject: sampling proportionate to size
> Hi All,
>
> Here´s another sampling question. I have a data set of n blocks that
looks
> like this:
>
> blockid persons cumpop
>
> 1 110 110
> 2 120 230
> 3 320 550
> 4 89 639
> 5 65 704
> ...
> n
>
>
> The number of persons living in each block varies a lot, so I want to get
a
> sample of blocks taking into account the size of the block (prob of block
j
> to be selected proportional to its weight in the cumulative pop figure).
>
> I think Raynald posted some time ago a piece of syntax to do something
> similar. TIA!!!!
>
>
> Gonzalo Kmaid
>
> ..