Go/no-go task
Score a press as correct on go trials and a withheld response as correct on no-go trials.
When to use it
Section titled “When to use it”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.
Trial file
Section titled “Trial file”| type | stimFormat | stim1 | presTime | responseWindow | keyboard | key |
|---|---|---|---|---|---|---|
| test | word | X | 300 | 1200 | space | space |
| test | word | X | 300 | 1200 | space | space |
| test | word | X | 300 | 1200 | space | space |
| test | word | O | 300 | 1200 | space | !space |
| test | word | X | 300 | 1200 | space | space |
| test | word | X | 300 | 1200 | space | space |
| test | word | O | 300 | 1200 | space | !space |
| test | word | X | 300 | 1200 | space | space |
type,stimFormat,stim1,presTime,responseWindow,keyboard,key test,word,X,300,1200,space,space test,word,X,300,1200,space,space test,word,X,300,1200,space,space test,word,O,300,1200,space,!space test,word,X,300,1200,space,space test,word,X,300,1200,space,space test,word,O,300,1200,space,!space test,word,X,300,1200,space,space
How it works
Section titled “How it works”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.
Variations
Section titled “Variations”- Tighten the deadline by lowering the
responseWindowtimeout; commission errors and late presses both surface as the ratio oftimeoutresponses shifts. - Block anticipatory presses with
responseWindowset tomin:100;max:1200; presses in the first 100 ms are buffered until the minimum ends. - Make each onset unpredictable with
ITIset to a range such as800_1600, which is redrawn on every presentation. - Tag rows as go or no-go in
condition1so the results file can be split without parsing the key cells.