NxChoose - Random sampling

Returns k objects taken (aka sampled) randomly from the input array..


NxChoose(X, K, ReplacementSeed, KeepNA)
is the input data sample (one/two dimensional array of cells (e.g. rows or columns)).
is the number of items to draw from X. If missing, Items is assumed one(1).
is the flag describing the draw mechanism: True=with replacement, False=without replacement (default). If missing, replacement is assumed false.
is the seed value of the random number generator. If missing, a random number from the CPU clock is used.
is a flag for leaving (or purging) observations with missing values (e.g. #N/A, #VALUE!, #NUM!, empty cell) found in the input data set. If missing, keepNA=False.


  1. The input data set may span multiple rows and/or columns, but the results is always one-dimensional array (i.e. column)..
  2. If the keepNA argument is set to False(0),observations with missing values (e.g. #N/A, #VALUE!, #NUM!, empty cell) in the input data set are purged prior to the choosing/sampling.
  3. If the replacement option is turned off, the value of the <strong>K</strong> arqument should not exceed the input data set size, otherwise NxChoose returns #N/A.
  4. If the keepNA argument is set to True(1), cells with missing value are preserved, and are sampled equally with other observations, and represented by #N/A in the returned array.
  5. The NxChoose function is available starting with version 1.66 PARSON.


Files Examples



Article is closed for comments.

Was this article helpful?
0 out of 0 found this helpful