Skip to content

Counterbalanced sides

Show a fixed pair of stimuli with the left and right assignment drawn once per participant, and score the choice correctly whichever side the target lands on.

Use this when two stimuli must appear side by side but which one is on the left has to vary across participants rather than across repetitions: two-alternative forced choices where side is a nuisance variable, preference pairs, or same-different displays. The crucial property is that the side assignment is drawn ONCE per session, so a participant sees a consistent layout while the sample as a whole is counterbalanced; and that scoring follows the stimulus, not the side.

typecontentstimFormatstimstimOrderstimPoskeybutton1
instructionsClick the animal that is a DOG. The pictures switch sides from person to person.NEXT
test.jpgdog1;cat1random(within 2)-200 0;200 0stim1
test.jpgdog2;cat2random(within 2)-200 0;200 0stim1
test.jpgdog3;cat3random(within 2)-200 0;200 0stim1

Each row lists the target first and the foil second in stim, and places the two display slots at -200 0 and 200 0 through stimPos. stimOrder = random(within 2) treats the whole two-item list as one unit and shuffles inside it, which for a pair simply means: half of participants get the authored order, half get it swapped. The draw happens once at the start of the session, so one participant’s sides stay consistent for the whole run, and the arrangement each participant actually saw is recorded in the stimOrder_actual results column.

This once-per-session draw is the difference from putting the bare random keyword in stimOptions: the keyword reshuffles at every display, which counterbalances across trials rather than across participants, and re-rolls a repeated trial every time it comes back.

Scoring survives the swap because key = stim1 refers to the STIMULUS authored first (the dog), not to a screen position. With no keyboard, buttons, or response type on a multi-image test row, the images themselves are the response: the participant clicks one, and the trial is scored correct when the clicked image is the authored stim1, wherever it was displayed.

  • Counterbalance across trials instead of participants: replace the stimOrder cell with stimOptions = random for a fresh shuffle at every display.
  • A sequence of pairs inside one trial: list all the stimuli in stim, add stimScreens = 2, and use stimOrder = random(within screens); the screens keep their fixed composition and order while sides shuffle independently within every screen.
  • Keyboard responses instead of clicks: side-contingent keys cannot be authored per row when sides vary, so keep clicks, or author both side variants as separate rows with explicit key letters and sample between them.
  • Triads instead of pairs: three stimuli with random(within 3) and a three-slot stimPos.