Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com), Millisecond
Created: March 01, 2012
Last Modified: January 07, 2025 by K. Borchert (katjab@millisecond.com), Millisecond
Script Copyright © Millisecond Software, LLC
This script implements a basic dual n-back procedure. The n-back task is a go/nogo working-memory performance task with increasing levels of difficulty.
The implemented procedure is based on:
Jaeggi, Susanne M.; Studer-Luethi, Barbara; Buschkuehl, Martin; Su, Yi-Fen; Jonides, John; Perrig, Walter J. (2010). The relationship between n-back performance and matrix reasoning - implications for training and transfer. Intelligence, 38, 625–635.
Millisecond thanks Dr. Susanne Jaeggi for kindly providing original instruction materials, stimuli, as well as assistance!
Adjustments to z-scores as recommended by: Gregg, A. & Sedikides, C. (2010). Narcissistic Fragility: Rethinking Its Links to Explicit and Implicit Self-esteem, Self and Identity, 9:2, 142-161 (p.148)
18 minutes
In Dual n-back tasks, participants are presented with two sequences of stimuli in two modalities at the same time Here: a) VISUAL: a random sequence of blue squares that can be presented in 8 different locations on the screen and b) AUDITORY: a random sequence of 8 spoken Roman letters In each trial one visual and one auditory stimulus are presented and participants are asked to indicate whether the currently presented stimuli fulfill the following criteria:
For N=0 trials: - is the location of the square the same as the target location? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the target letter? If so (it's a target), and press "L". If not, don't press "L".
For N=1 trials: - is the location of the square the same as the one in the previous trial? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one in the previous trial? If so (it's a target), and press "L". If not, don't press "L".
For N=2 trials: - is the location of the square the same as the one two trials before? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one two trials before? If so (it's a target), and press "L". If not, don't press "L".
For N=3 trials: - is the location of the square the same as the one three trials before? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one three trials before? If so (it's a target), and press "L". If not, don't press "L".
For N=4 trials: - is the location of the square the same as the one four trials before? If so (it's a target), and press "A". If not, don't press "A". - is the letter the same as the one four trials before? If so (it's a target), and press "L". If not, don't press "L".
Etc. for increasing levels of N
(1) Dual n-back Experiment (non-adaptive) information:
- After instructions, participants receive 10 trials of practice per level N tested (here: N = 1, N = 2, N = 3) - with possibility of repeat (editable).
- After practice, participants receive 3 blocks per level N tested (here: N = 1, N = 2, N = 3) (see list.nextN for possible edits)
N-levels run
The levels and repetitions of N run by this script are controlled by list.nextNPractice and list.nextN under section Editable Lists.
By default, the list runs the selection items in sequence.
The levels of N can be easily altered (if altered for practice, the instruction slides might have to be edited as well)
(2) Dual n-back BLOCK information:
- Each dual n-task block consists of 20 + trials.
=> + trials are the N trials that cannot display target shapes yet (=start trials). Their numbers vary depending on N. The data collected during these
start trials are NOT included in performance counts for Correct Rejections/False Alarms.
=> Of the actual 20 experimental trials, 4 present a visual target only, 4 present an auditory target only, 2 present both targets
and 10 present no targets at all
- The computer selects randomly
a) which kind of trial
b) what letter/ square location to use if it is not a target
(3) Dual n-back TRIAL informations:
- Each trial presents the square/letter for 500ms and waits another 2500ms before presenting the next square/letter in the sequence.
- Participants have the entire 3000ms to respond by pressing "A", "L", or both if they detect a target or two.
8 letter sound files, see section Editable Stimuli
a blue square
provided by Millisecond - can be edited under section Editable Instructions
Instructions are provided by Millisecond
as htm pages and simple page elements and can be edited either by changing
the provided html files or directly under Editable Instructions.
in order for the instructions to reflect alternative parameter settings,
some of the conditionalized code used in the htm files can be found in the script itself.
File Name: dualnbacktaskSummary*.iqdat
| Name | Description |
|---|---|
| inquisit.version | Inquisit version number |
| computer.platform | Device platform: win | mac |ios | android |
| startDate | Date the session was run |
| startTime | Time the session was run |
| subjectId | Participant ID |
| groupId | Group number |
| sessionId | Session number |
| elapsedTime | Session duration in ms |
| completed | 0 = Test was not completed 1 = Test was completed |
| totalBlocks | The total number of experimental blocks run the following summary variables are only based on performance on trial.target/trial.nontarget (excludes trial.start even if parameters- excludeStartTrialfromPerformanceMeasure = false) |
| propCorrectOverall | Overall proportion correct (across all test blocks) z-score calculations: adjustments (see Gregg & Sedikides, 2010, p.148) If the hit rate FA rate is 0 => 0.005 is used instead (aka 0.005 is added to the hitFA rate) IF the hit rate FA rate is 1.0 => 0.995 is used instead (aka 0.005 is subtracted from the hitFA rate) |
| list.vHits.itemCount | The number of visual target trials across all test blocks |
| vHitRateOverall | The hitRate for visual targets across all test blocks (hit: pressing A for a visual target) |
| vMissRateOverall | The overall miss rate for visual targets |
| list.vFAs.itemCount | The number of visual nontarget trials across all test blocks |
| vFaRateOverall | The false alarm rate for visual nontargets across all test blocks (False Alarm: pressing A for a visual nontarget) |
| vCrRateOverall | The overall correct rejection rate for visual nontargets |
| zVHitRateOverall | Computed z-score of the visual hitRate |
| zVFaRateOverall | Computed z-score of the visual false alarm rate |
| dPrimeVisualOverall | Visual d' (parametric measure of sensitivity) The higher the value, the better visual targets were overall correctly distinguished from visual nontargets (d' = 0: chance performance; negative values: nontargets were treated as targets and targets were treated as nontargets) |
| cVisualOverall | C-criterion in signal detection:The absolute value of c provides an indication of the strength of the response bias/response style negative: participant more likely to report that signal (non-alcoholic stimuli) is present (liberal response style) may favor faster responding in speed-accuracy trade-off response paradigms positive: favoring caution (conservative response style) |
| list.aHits.itemCount | The number of Audio target trials across all test blocks |
| aHitRateOverall | The hitRate for Audio targets across all test blocks (hit: pressing A for a Audio target) |
| aMissRateOverall | The overall miss rate for auditory targets |
| list.aFAs.itemCount | The number of Audio nontarget trials across all test blocks |
| aFaRateOverall | The false alarm rate for Audio nontargets across all test blocks (False Alarm: pressing A for a Audio nontarget) |
| aCrRateOverall | The overall correct rejection rate of auditory nontargets |
| zAHitRateOverall | Computed z-score of the Audio hitRate |
| zAFaRateOverall | Computed z-score of the Audio false alarm rate |
| dPrimeAudioOverall | Audio d' (parametric measure of sensitivity) The higher the value, the better Audio targets were overall correctly distinguished from Audio nontargets (d' = 0: chance performance; negative values: nontargets were treated as targets and targets were treated as nontargets) |
| cAuditoryOverall | C-criterion for auditory condition |
| dv | ((vTotalHits - vTotalFA) + (aTotalHits - aTotalFA))/2) /number of total experimental blocks Dependent Variable suggested by Jaeggi et al (2010) |
File Name: dualnbacktaskRaw.iqdat
| Name | Description |
|---|---|
| build | Inquisit version number |
| computer.platform | Device platform: win | mac |ios | android |
| date | Date the session was run |
| time | Time the session was run |
| subject, group, | With the current subject/groupnumber |
| session | Session number |
| blockCode | Name of the current block |
| blockNum | Number of the current block |
| trialCode | Name of the current trial |
| trialNum | Number of the current trial |
| totalBlocks | The total number of experimental blocks run |
| n | The current level N tested |
| startTrialCounter | Keeps track of how many start trials have been run |
| stimulusItem.1 | The shape presented |
| vPosition | Contains the position of the current square 1 = (25%, 25%), 2 = (50%, 25%), 3 = (75%, 25%), 4 = (25%, 50%), 5 = (75%, 50%), 6 = (25%, 75%), 7 = (50%, 75%), 8 = (75%, 75%) |
| vCurrentTarget | The position number of the current visual target |
| stimulusItem.2 | The letter presented |
| aStimNumber | The itemNumber of the current letter audio file |
| aCurrentTarget | The itemNumber of the current visual target |
| response1 | Stores the scancode of the first response made in a trial 30 = A (response key for a visual target) 38 = L (response key for an auditory target) 0 = no response made |
| latency1y | The latency (in ms) of the first response |
| response2 | Stores the scancode of the second response made in a trial 30 = A (response key for a visual target) 38 = L (response key for an auditory target) 0 = no response made |
| latency2 | The latency (in ms) of the second response |
| vResponseCategory | "vHit" vs. "vOmission Error" vs. "vCorrReject" vs. "vCommission Error" |
| aResponseCategory | "aHit" vs. "aOmission Error" vs. "aCorrReject" vs. "aCommission Error" |
| correct | The correctness of the response (1 = completely correct; 0 = otherwise) |
| latency | The latency (in ms) of the last response made (if any), no response => latency will be equal to SOA |
| list.blockAcc.mean | Proportion correct during the current block (start trials are excluded in block acc assessment by default, editable) correct = visual AND audio response are correct; error = any other response pattern |
| list.blockAccVisual.mean | Proportion correct visual responses during the current block (start trials are excluded in block acc assessment by default, editable) |
| list.blockAccAudio.mean | Proportion correct audio responses during the current block (start trials are excluded in block acc assessment by default, editable) |
The procedure can be adjusted by setting the following parameters.
| Name | Description | Default |
|---|---|---|
| allowPracticeRepeat | True: practice can be repeated as often as indicated (default) false: practice cannot be repeated | |
| excludeStartTrialfromPerformanceMeasure | True (1): performance during start trials that cannot be targets yet is not considered for BLOCK level performance analyses (aka feedback purposes) (default) false (0): performance during start trials that cannot be targets yet IS considered for BLOCK level performance (aka feedback purposes) analyses (default) | |
| soa | Stimulus Onset Asynchrony | 3000ms |
| stimulusPresentationTime | The presentation time (in ms) of the stimuli | 500ms |
| debugMode | DebugMode = 1: targetAlerts are shown on screen, debugMode = 0, no targetAlerts are shown (default) (in general: if levels of N are changed, adjustments need to be made to instructions and list.Nlevel) | 0 |