NxChoose - Random sampling

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

Syntax

NxChoose(X, K, ReplacementSeed, KeepNA)
X
is the input data sample (one/two-dimensional array of cells (e.g. rows or columns)).
K
is the number of items to draw from X. If missing, Items is assumed one(1).
Replacement
is the flag describing the draw mechanism: True=with replacement, False=without replacement (default). If missing, replacement is assumed false.
Seed
is the seed value of the random number generator. If missing, a random number from the CPU clock is used.
KeepNA
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.

Remarks

  1. The input data set may span multiple rows and/or columns, but the result is always a 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> argument 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 values 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

References

Comments

Article is closed for comments.

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