Random sample selection without replacement (using IMSL_RANDOM_SAMPLE) [message #78018] |
Fri, 21 October 2011 02:59 |
Patrick Leinenkugel
Messages: 5 Registered: June 2011
|
Junior Member |
|
|
Hello,
I like to generate a random selection (eg. 5 samples) of a population
without replacement from a one dimensional array with n samples (eg.
n=100). I tried to use the IMSL_RANDOM_SAMPLE function which works
fine if I have (k,n) dimensional arrays (k variables (e.g k=2), n
samples( e.g n=100)).
For one dimensional arrays, however, the command
samp = IMSL_RANDOM_SAMPLE(5, pop)
results in the error message: "IMSL Error: IMSL_RANDOM_SAMPLE:
Terminal error: STAT_BAD_NROW_NSAMP: NROW = 1 and NSAMP = 5. Since
there is only one invocation of this function, NROW must be greater
than or equal to nsamp."
Can anyone tell me what I do wrong or has a nother way to easily
generate random selection without replacement.
Thanks,
Patrick
|
|
|