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 (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 29 Sep 2005 12:59:20 -0400
Reply-To:     Richard Ristow <wrristow@mindspring.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Richard Ristow <wrristow@mindspring.com>
Subject:      Re: Random number  without  replacement
Comments: To: Abdus Salam <mou_salam@yahoo.com>
In-Reply-To:  <20050929060731.62124.qmail@web31115.mail.mud.yahoo.com>
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 02:07 AM 9/29/2005, Abdus Salam wrote:

>Thanks a lot for your quick response. If I wanted to do the same thing >with replacement then what I have to do in SPSS.

Sure. Even easier; see below. (Remember, random phone-number lists for telephone surveys should be without replacement.)

|---------------------------|-----------------------| |Output Created |29 Sep 05 12:55:05 | |---------------------------|-----------------------| AREACODE EXCHANGE

771 252 771 253 771 222

Number of cases read: 3 Number of cases listed: 3

* Initialize random-number generator: . DO IF $CASENUM = 1. * Seed: trailing four digits of third number on . * p. 769 of Providence, RI, telephone book for 2005. . . SET SEED = 3191. * "Throw away" 100 variates, to bypass anomalous . * variates that may occur immediately post-seeding . - LOOP # = 1 TO 100. . COMPUTE #DISCARD = RV.UNIFORM(0,1). - END LOOP. END IF.

COMPUTE #K = 10 /* Desired sample size */. COMPUTE #LO = 1 /* Lowest integer in desired range */. COMPUTE #HI = 9999 /* Highest integer in desired range */.

NUMERIC NUMBER (N4).

LOOP #COUNT = 1 TO #K. . COMPUTE NUMBER = TRUNC(RV.UNIFORM(#LO,#HI+1)). . XSAVE OUTFILE=SAMPLE. END LOOP. EXECUTE. GET FILE=SAMPLE. LIST.

List Notes |---------------------------|-----------------------| |Output Created |29 Sep 05 12:55:07 | |---------------------------|-----------------------| AREACODE EXCHANGE NUMBER

771 252 9489 771 252 4589 771 252 2201 771 252 6990 771 252 5246 771 252 9812 771 252 8244 771 252 0980 771 252 9940 771 252 7218 771 253 3453 771 253 2833 771 253 5987 771 253 2591 771 253 9524 771 253 2614 771 253 8220 771 253 8565 771 253 6379 771 253 1695 771 222 7389 771 222 3780 771 222 0473 771 222 1761 771 222 8649 771 222 0203 771 222 1377 771 222 8030 771 222 6790 771 222 4522

Number of cases read: 30 Number of cases listed: 30

* If desired: . SORT CASES BY AREACODE EXCHANGE NUMBER. LIST.

List Notes |---------------------------|-----------------------| |Output Created |29 Sep 05 12:55:08 | |---------------------------|-----------------------| AREACODE EXCHANGE NUMBER

771 222 0203 771 222 0473 771 222 1377 771 222 1761 771 222 3780 771 222 4522 771 222 6790 771 222 7389 771 222 8030 771 222 8649 771 252 0980 771 252 2201 771 252 4589 771 252 5246 771 252 6990 771 252 7218 771 252 8244 771 252 9489 771 252 9812 771 252 9940 771 253 1695 771 253 2591 771 253 2614 771 253 2833 771 253 3453 771 253 5987 771 253 6379 771 253 8220 771 253 8565 771 253 9524

Number of cases read: 30 Number of cases listed: 30


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