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.
Syntax
Section titled “Syntax”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,randomandrandomPickare all identical; a row with an emptyrandomPickcell 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
trialGroupand 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.
Options
Section titled “Options”| Value | Effect |
|---|---|
| empty cell | Trial 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 |
0 | Drops 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 size | All 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 |
Defaults & missing values
Section titled “Defaults & missing values”- When the column is absent, or every cell is left blank, no picking happens and every trial runs.
- When
randomPickcarries any value, the initialrandom/randomBlockshuffling pass is skipped; both are applied only after picking. - Trials with a non-empty
staircasecell never participate in picking; theirrandomPickvalue is ignored.
Works with
Section titled “Works with”- random / randomBlock: when
randomPickcarries values, the normal initialrandom/randomBlockpass 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 (
trialOrdervalues like1: sample 10): the specs are the successor mechanism; a file that mixesrandomPickvalues with specs is rejected when saved, with an error telling you to express the sampling astrialOrderspecs. - 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.
Examples
Section titled “Examples”Show 2 of 4 test trials (mode A, no trialGroup column):
| type | stimFormat | stim1 | randomPick |
|---|---|---|---|
| instructions | intro | ||
| test | .png | a | 2 |
| test | .png | b | 2 |
| test | .png | c | 2 |
| test | .png | d | 2 |
type,stimFormat,stim1,randomPick instructions,,intro, test,.png,a,2 test,.png,b,2 test,.png,c,2 test,.png,d,2
Two pools split by a value change; 1 picked from the first, 2 from the second:
| type | stimFormat | stim1 | randomPick |
|---|---|---|---|
| test | .png | a1 | 1 |
| test | .png | a2 | 1 |
| test | .png | b1 | 2 |
| test | .png | b2 | 2 |
| test | .png | b3 | 2 |
type,stimFormat,stim1,randomPick test,.png,a1,1 test,.png,a2,1 test,.png,b1,2 test,.png,b2,2 test,.png,b3,2
Pick and then shuffle surviving blocks (randomBlock re-applied post-pick):
| type | stimFormat | stim1 | randomPick | randomBlock |
|---|---|---|---|---|
| test | .png | a1 | 1 | 1 |
| test | .png | a2 | 1 | 1 |
| test | .png | b1 | 1 | 2 |
| test | .png | b2 | 1 | 2 |
type,stimFormat,stim1,randomPick,randomBlock test,.png,a1,1,1 test,.png,a2,1,1 test,.png,b1,1,2 test,.png,b2,1,2
Tips & gotchas
Section titled “Tips & gotchas”- 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
randomcolumn 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
randomPickvalue 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).