Skip to content

Go/no-go task

Score a press as correct on go trials and a withheld response as correct on no-go trials.

Use this to measure response inhibition: frequent go stimuli build a prepotent press, and rare no-go stimuli test whether the participant can withhold it. The naive scoring approach fails because withholding never produces a response event to compare against an answer, so the trial must end on a deadline and the scoring must treat that deadline as the correct outcome. Pick a two-choice reaction time design instead when both stimulus classes require a press.

typestimFormatstim1presTimeresponseWindowkeyboardkey
testwordX3001200spacespace
testwordX3001200spacespace
testwordX3001200spacespace
testwordO3001200space!space
testwordX3001200spacespace
testwordX3001200spacespace
testwordO3001200space!space
testwordX3001200spacespace

Each row shows a single letter (stim1, rendered as text via stimFormat word) for 300 ms of presTime, with X the go signal and O the no-go signal, at a 3:1 ratio so pressing stays the dominant habit.

The numeric responseWindow is what makes no-go trials scoreable: 1200 opens the window when the stimulus appears and closes it 1200 ms later, and a trial that closes with no press records the response timeout and auto-advances. Without a timeout, a correctly withheld no-go trial would sit on a blank screen forever, because the default window stays open indefinitely.

keyboard set to space accepts only the space bar, so the trial can end just two ways: the recorded response is either space or timeout. That is what makes the key scoring exact. On go rows key is space, so a press is correct and a timeout incorrect. On no-go rows key is !space, the negation form meaning correct when the response is anything other than space; the only other possible response is timeout, so withholding scores 1 in the correct results column and a false alarm scores 0. Keep the key values lowercase; a response that matches only after ignoring case is recorded as unscored rather than incorrect.

Reaction time is counted from the moment the window opens, here stimulus onset, so go-trial RTs read directly from the results.

  • Tighten the deadline by lowering the responseWindow timeout; commission errors and late presses both surface as the ratio of timeout responses shifts.
  • Block anticipatory presses with responseWindow set to min:100;max:1200; presses in the first 100 ms are buffered until the minimum ends.
  • Make each onset unpredictable with ITI set to a range such as 800_1600, which is redrawn on every presentation.
  • Tag rows as go or no-go in condition1 so the results file can be split without parsing the key cells.