subjectGroup
Experiments Surveys & forms
subjectGroup implements between-subjects designs. Each session, the participant is assigned one subgroup per group label (randomly by default, or evenly across participants when the project’s even-allocation setting is on) and then sees only the trials tagged with a picked subgroup plus all untagged trials. Use it to give different participants different trial subsets (conditions, counterbalancing lists).
Syntax
Section titled “Syntax”Put a subgroup number in the subjectGroup cell of every trial that belongs to that subgroup, for example 1 on the trials of the first list and 2 on the trials of the second, and leave the cell empty on trials everyone should see. Each participant is allocated one subgroup and runs only its trials plus the untagged ones.
To vary more than one thing at a time, give the group a name and write <label>:<number>, for example taskOrder:1 and colour:2. Each name is a factor of its own: exactly one subgroup is allocated per name, so a file mixing colour:1/colour:2 with size:1/size:2 gives every participant one colour AND one size.
The values a cell accepts:
<- empty: trial belongs to no group; shown to every participant0 <- same as an empty cell<int> <- subgroup <int> of the current group name<label>:<int> <- subgroup <int> of the named group <label>The number after the colon must be digits. A bare word such as A is not a group name: it leaves the trial ungrouped and shown to everyone (see Tips & gotchas).
Options
Section titled “Options”| Value | Read as | Effect |
|---|---|---|
| empty cell | no group | Trial shown to everyone |
0 | no group | Same as an empty cell |
positive integer N (e.g. 1, 2) | subgroup N of the current group name | Trial shown only to participants allocated subgroup N of that group |
label:N (e.g. taskOrder:2) | group label, subgroup N | Trial shown only to participants allocated label:N |
label:0 | group label, subgroup 0 | Subgroup 0 is never allocated, so the trial is shown to everyone |
non-numeric bare string (e.g. A, groupB) | no group, under the current group name | Trial shown to everyone. Letter group names WITHOUT the label:N syntax do not create selectable subgroups; see Tips & gotchas for the all-zero-group edge case |
decimal like 2.5 | truncated to 2 | Behaves as subgroup 2 |
Defaults & missing values
Section titled “Defaults & missing values”If the column is absent, or every cell is empty or 0, there are no groups: nothing is allocated and every participant runs every trial.
Once groups do exist, rows left empty (or set to 0) are kept for every participant, whichever subgroup they were allocated. Use them for the parts of the experiment everyone shares, such as instructions, practice and debrief screens.
Works with
Section titled “Works with”randomandrandomBlock: trials are shuffled before the group is allocated, so shuffling and group filtering combine cleanly.randomPick: the pick happens after group filtering, so it draws only from the trials this participant’s subgroup is entitled to.break: a break defined on a row tagged with a subgroup the participant was not allocated is dropped along with that row’s trials, so each group only gets its own breaks.- Results: the allocated subgroups are saved in a
subjectGroupresults column, space-separated when several groups are in play (for exampletaskOrder:1 colour:2). Per-trial values are recorded too, and cells set to0come out blank in exported results. - Recruitment reporting: participation events record the allocated subgroup, so you can see how many participants each group received.
- Scripts you add with
scriptcan read the allocated subgroups fromwindow.testableSDK.allocatedSubjectGroups.
Examples
Section titled “Examples”Simple two-list counterbalancing (no group name):
| type | subjectGroup | target |
|---|---|---|
| instructions | Welcome | |
| test | 1 | listA_1.png |
| test | 1 | listA_2.png |
| test | 2 | listB_1.png |
| test | 2 | listB_2.png |
type,subjectGroup,target instructions,,Welcome test,1,listA_1.png test,1,listA_2.png test,2,listB_1.png test,2,listB_2.png
Each participant is randomly assigned subgroup 1 or 2 and sees the welcome screen plus only that list. Results record subjectGroup as 1 or 2.
Two crossed factors with named groups:
| type | subjectGroup | target |
|---|---|---|
| test | taskOrder:1 | firstTaskA.png |
| test | taskOrder:2 | firstTaskB.png |
| test | colour:1 | red.png |
| test | colour:2 | blue.png |
| test | 0 | sharedTrial.png |
type,subjectGroup,target test,taskOrder:1,firstTaskA.png test,taskOrder:2,firstTaskB.png test,colour:1,red.png test,colour:2,blue.png test,0,sharedTrial.png
One taskOrder subgroup and one colour subgroup are picked independently; sharedTrial runs for everyone. Saved info value looks like taskOrder:1 colour:2.
Group-specific break:
| type | subjectGroup | break |
|---|---|---|
| break | 2 | trials:20 |
type,subjectGroup,break break,2,trials:20
Only participants allocated subgroup 2 get this break; for everyone else it is filtered out.
Tips & gotchas
Section titled “Tips & gotchas”- Bare words such as
AorgroupBare silently treated as “no group”, so those trials go to every participant and you get no warning. Use1,2ortaskOrder:1instead. - Everything before the last colon is the group name, so
a:b:2means subgroup2of a group calleda:b. - A value like
2:1is read as the plain number2, not as group2subgroup1. - Break rows follow the same rules as trial rows, so a break tagged
2.5behaves as subgroup2. - A group whose cells are all
0(or all bare words) has no subgroup to allocate. Every trial still runs, but the savedsubjectGroupvalue and the participation records for it come out asundefined. Give a group at least two real subgroups, or leave its cells empty. - Under even allocation the per-trial
subjectGroupvalues in saved results keep ansg:prefix (for examplensg:2instead of2) when you use plain numbers. Account for that when parsing results. - Even allocation counts a participant as soon as their session starts, and only releases the slot if they close the tab normally. A browser crash can therefore leave a subgroup looking fuller than it is.
- Previews are allocated a group like real sessions, and show only that group’s trials, but never count towards even allocation.
Common combinations
Section titled “Common combinations”subjectGroup appears in these worked recipes:
- Between-subject conditions: Give each participant one of two stimulus sets, while shared screens run for everyone.
- Factorial vignette study: Show each participant one version of a scenario from a factorial design, then have everyone rate it on the same questions.
- Counterbalanced key mapping: Give half the participants one response-key mapping and half the reversed mapping, with matching instructions for each.