Random sample

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Random sample

Bill Wu
  I try to randomly select 200 cases from 1000 and each time I will get
the same cases. Is there anyway I can select different cases at
different times?

Bill

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Random sample

Bruce Weaver
Administrator
Bill Wu wrote
  I try to randomly select 200 cases from 1000 and each time I will get
the same cases. Is there anyway I can select different cases at
different times?

Bill
You must have the same SEED value every time.  This is from the Help for "SET (command), SEED subcommand":

SEED={integer | RANDOM}  Initialization value for MC random number generator. The value must be a positive integer that is less than 2,000,000,000 or the keyword RANDOM, which randomly sets the initialization value. The default is 2,000,000.

Try this:

SET SEED = RANDOM.

Then select your random sample.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).