Skip to content

randomPick

Experiments Surveys & forms

Randomly selects N trials out of a pool of consecutive candidate trials and drops the rest from the run order. Use it to sample from a larger stimulus set (e.g. show 10 of 40 items) so each participant sees a different subset. Dropped trials never run and produce no result rows.

Put the same integer N on every trial of the pool: N of those trials are kept at random and the rest are dropped. The randomPick value is itself part of the pool grouping, so every row of a pool carries the same N; a value change splits pools. Trials with an empty cell are always kept.

How pools are formed depends on whether a trialGroup column header exists in the trial file:

A. Without trialGroup

  • Pools are maximal contiguous runs of rows where type, randomBlock, random and randomPick are all identical; a row with an empty randomPick cell is a hard boundary.
  • If N is smaller than the pool: N trials are randomly chosen and the survivors are re-emitted in random order at the pool’s positions. If N is the pool size or larger: all trials are kept in their original order.

B. With a trialGroup column present

  • Pools additionally group by trialGroup and the trial’s timer label.
  • Survivors are always re-emitted in random order, even when N is the pool size or larger.

In both modes: N is capped at the pool size; trials with an empty cell keep their relative positions (dropped rows are simply removed, so later rows shift up); the selection of survivors consults random.org when the project’s advanced randomness setting is on, while the order of the survivors always comes from the local random generator. After picking, within-block shuffling is re-applied and then blocks are re-shuffled if randomBlock is in use. A sampling error stops the experiment with a visible message instead of running an unsampled design.

ValueEffect
empty cellTrial is always kept; acts as a pool boundary
integer N (e.g. 5)Keep N randomly chosen trials from the pool, capped at the pool size
0Drops the whole pool (sample of 0)
negative N (e.g. -2)Treated as 0, so the whole pool is dropped
fractional N (e.g. 2.5)Rounded up (picks 3). Scientific and hex notation are also read as numbers: 1e2 reads as 100, 0x10 as 16
N >= pool sizeAll pool trials kept; in mode A their original order is preserved, in mode B they are still re-emitted in random order
non-numeric token (e.g. abc, 3x)The pool gets no sampling: all trials are kept in their original order, with no shuffle, in both modes
  • When the column is absent, or every cell is left blank, no picking happens and every trial runs.
  • When randomPick carries any value, the initial random/randomBlock shuffling pass is skipped; both are applied only after picking.
  • Trials with a non-empty staircase cell never participate in picking; their randomPick value is ignored.
  • random / randomBlock: when randomPick carries values, the normal initial random/randomBlock pass is skipped; both are applied only after picking, within blocks first, then between blocks. Both values are also part of the pool grouping, so changing them mid-run splits pools.
  • trialGroup: the mere presence of the column header switches from mode A to mode B, regardless of its values.
  • type: part of the pool grouping in both modes; a type change splits pools.
  • timer (labels): part of the pool grouping in mode B only.
  • staircase: staircase trials never participate in picking.
  • trialOrder sampling specs (trialOrder values like 1: sample 10): the specs are the successor mechanism; a file that mixes randomPick values with specs is rejected when saved, with an error telling you to express the sampling as trialOrder specs.
  • Progress bar / trial count: both reflect the shortened trial list, not the full file.
  • Advanced randomness: with the project’s advanced randomness setting on, the selection draws (which trials survive) consult random.org in both modes, costing one random.org request per picked trial. The random-order re-emission of the survivors and the post-pick block re-shuffle always use the local random generator.

Show 2 of 4 test trials (mode A, no trialGroup column):

typestimFormatstim1randomPick
instructionsintro
test.pnga2
test.pngb2
test.pngc2
test.pngd2

Two pools split by a value change; 1 picked from the first, 2 from the second:

typestimFormatstim1randomPick
test.pnga11
test.pnga21
test.pngb12
test.pngb22
test.pngb32

Pick and then shuffle surviving blocks (randomBlock re-applied post-pick):

typestimFormatstim1randomPickrandomBlock
test.pnga111
test.pnga211
test.pngb112
test.pngb212
  • Picking also randomizes order: in mode A with N smaller than the pool, the kept trials are permuted among the pool’s surviving positions, even when the random column is empty everywhere. Mode B shuffles the pool’s survivors unconditionally. This permutation always uses the local random generator, never random.org.
  • In mode A, an N at or above the pool size passes the pool through untouched, so an over-large N silently disables sampling for that pool (in mode B the order is still shuffled).
  • The randomPick value is part of the pool grouping, so all rows of a pool carry the same N; writing a different N on a row does not “override” anything, it starts a new pool.
  • After picking, shuffling always happens within blocks first, then between blocks, in both modes.
  • Values are read as numbers: fractional values round up, negatives drop the pool, and non-numeric values are not rejected but disable sampling for their pool (see Options).