User Manual: Inquisit Child NBack Task


								Child Letter N-back (2-key version)

Script Author: Katja Borchert, Ph.D. ( for Millisecond Software LLC
last updated:  05-09-2023 by K. Borchert ( for Millisecond Software, LLC

Script Copyright © 05-09-2023 Millisecond Software

Millisecond Software thanks Dr. Pelegrina for generously sharing source material!

This script implements a basic letter n-back procedure used in research with children to obtain norming data
for children aged 7-13. 
The n-back task is a go/nogo working-memory performance task with increasing levels of difficulty.

The implemented nback procedure is based on:

Pelegrina, S. et al (2015). Normative data on the n-back task for children and young adolescents.	
Frontiers in Psychology, 6. 

The article can be downloaded at:

Note: Dr. Pelegrina kindly shared the original eprime script cited in Pelegrina et al (2015)

Adjustments to z-scores done in this Inquisit script 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)
In the 2-key single n-back task, participants are shown a sequence of stimuli (here: a sequence of black letters
on a white background) and are asked to indicate whether the currently presented stimulus fulfills the 
following criteria:

for N=0 trials:
- is the letter the same as the letter 'X'? If so (it's a target), press "1". If not, press "2".

for N=1 trials:
- is the letter the same as the one that preceded it? If so (it's a target), press "1". If not, press "2".

for N=2 trials:
- is the letter the same as the one presented two trials before? If so (it's a target), press "1". If not, press "2".

for N=3 trials:
- is the letter the same as the one presented three trials before? If so (it's a target), press "1". If not, press "2".

The default setup of this script runs 2 blocks of:
- 1back
- 2back
- 3back
in that order but can be easily edited to run 0backs-3backs.
the default set-up of the script takes appr. 15 minutes to complete

The default data stored in the data files are:

(1) Raw data file: 'childletternbacktask_raw.iqdat' (a separate file for each participant)

build:							The specific Inquisit version used (the 'build') that was run
computer.platform:				the platform the script was run on (win/mac/ios/android)
date, time: 					date and time script was run 
subject, group, 				with the current subject/groupnumber
session:						with the current session id

blockcode, blocknum:			the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum: 			the name and number of the currently recorded trial (built-in Inquisit variable)
									Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
									that do not store data to the data file such as feedback trials. Thus, trialnum 
									may not reflect the number of main trials run per block. 
phase:							'practice' vs. 'test'
blockcounter_perlevelN:			tracks the number of blocks run per N-level tested
N:								the current level N tested
starttrialcounter:				keeps track of how many start trials have been run
stimulusitem.1:					the letter presented
stimulusnumber.1: 				the item number of the presented letter
currenttarget:					the item number of the current target

response:						the Response of the participant (SCANCODE of response button):
								0 = no response
								2 => '1' key (target key)
								3 => '2' key (non target key)
responsetext:					stores the actual key pressed ("1" vs. "2")								
responseCategory:				"Hit": pressed target key for target
								"Miss": pressed nontarget key for target
								"CR": pressed nontarget key for nontarget 
								"FA": pressed target key for nontarget 
								"NR": did not press any response key

correct:						the correctness of the response (1 = correct; 0 = otherwise)

latency:						how fast a participant responded within the given timeframe, if at all (in ms)
								no responses = the entire trialduration
list.blockACC.mean:				proportion correct during the current block (start trials are excluded from block ACC assessment)

(2) Summary data file: 'childletternbacktask_summary*.iqdat' (a separate file for each participant)

inquisit.version:				Inquisit version run
computer.platform:				the platform the script was run on (win/mac/ios/android)
startdate:						date script was run
starttime:						time script was started
subjectid:						assigned subject id number
groupid:						assigned group id number
sessionid:						assigned session id number
elapsedtime:					time it took to run script (in ms); measured from onset to offset of script
completed:						0 = script was not completed (prematurely aborted); 
								1 = script was completed (all conditions run)
scriptabort:					0 = the script was not ended prematurely due to low performance in one test block
								1 = the script was prematurely ended due to low performance in one test block

//parameter settings:
calculate_pvalues:				true (1): the script will collect age and gender information at the end 
								and report a p-values for the total hits (across 1back, 2back and 3back conditions)
								using the normative data reported by Pelegrina et al (2015, table4)
								false (0): no p-values are reported
useGenderInfo:					true (1): gender information is used when reporting p-values for total hits
								false (0): no gender information is used when reporting p-values.
								Reported p-values are based on the pooled data of both genders. 
								Pooled data are calculated by this script using the provided
								numbers in table 4 (Pelegrina et al, 2015).

the following summary variables are only based on performance on 

propCorrect_total:		overall proportion correct (across all test blocks and level of N tested)
Hits_total:				overall number of hits (across all test blocks and level of N tested)
z_value_1back:			the calculated z-value for the total hits (across 1back, 2back, 3back)
p_value_1back:			the calculated p-value for the total hits (across 1back, 2back, 3back) (based on selected mean and standard deviation information for that age group)
referenceMean_1back:	the reference Mean used for calculating hit p-value for the 1back task
referenceSD_1back:		the reference standarddeviation used for calculating hit p-value for the 1back task

meanHit_RT_total:		the overall mean hit response time (in ms)
Misses_total:			overall number of misses (across all test blocks and level of N tested)
CR_total:				overall number of correct rejections (across all test blocks and level of N tested)
FA_total:				overall number of false alarms (across all test blocks and level of N tested)
NR_total:				overall number of no responses (across all test blocks and level of N tested)

//Signal Detection

Note: 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)

hitrate_total: 			the overall hitrate (number of hits/number of targettrials)
zhitrate_total:			the z-converted hitrate
FArate_total: 			the overall false alarm rate (number of false alarms/number of nontarget trials)
zFArate_total: 			the z-converted FArate

dprime_total:			Computes d' (parametric measure of sensitivity):
						=> Range (in this script): 
						-5.1516586840152740479 <= dprime <= 5.1516586840152740479 (=perfect performance)
						The higher the value, the better targets were overall correctly distinguished 
						from nontargets (d' = 0: chance performance; negative values: nontargets were treated as targets
						and targets were treated as nontargets)				

(same for each level of N tested, no norms are reported by this script.)


This script provides code to run 0backs, 1backs, 2backs and 3backs in sequential order.
By default, this script only runs the 1back, 2back and 3back condition.
Check section Editable Parameter to skip/add conditions.

For each level of N-back, participants:
1. receive instructions (which can be repeated as often as necessary)
2. practice block: N start trials + 20 test trials (6 targets, 14 nontargets) - practice is repeated if the practice hitrate is below 60%
3. test: 2 test blocks (editable number) with N start trials + 20 trials (6 targets, 14 nontargets)
Test is prematurely terminated if performance in one of the test blocks sinks below 60%correct.

Trial Information:
- The computer selects randomly 
a) whether it is a target trial or not and 
b) what letter to show if it is not a target trial
Note: Based on shared original e-prime script, notarget letters are selected randomly without replacement 
from 20 consonants.

Trial Sequence:
- Each trial presents the letter for 500ms and waits another 3000ms before presenting the next letter in the sequence
(editable durations)
- Participants have the entire 3500ms to respond


One important goal of Pelegrina et al (2015) was to report n-back norming data for children 7-13 years
of age. The reported norms can be found in Table 4.

Norming Sample: Pelegrina et al (2015) tested a total of 3722 Spanish children and adolescents 
(1886 boys and 1836 girls) aged 7–13 years. 

Testing Design: Each child was tested with 2 blocks for (letter) 1back, 2back, 3back (sequential block order) 
with 20 trials each (30% targets). If a child did not reach 60% correct during a test block, 
the task was prematurely terminated.

Result: Table 4 provides means (of hits only), standard deviations and p-levels by nback level, age and gender.
Pelegrina et al (2015) further report:
"This component showed that age-related increases in performance diminished with age.
Gender was found to be a predictor only in the 1-back condition and for total hits. Girls
obtained a higher number of hits than boys at both levels of the task. (p.6)"

Script: p-values reported in this script are solely based on reported means and standarddeviation.
By default this script reports p-values for total hits across 1back, 2back and 3back levels using
weighted means of male and female means as well as pooled standarddeviations.
If gender specific values are needed, go to section Editable Parameters and check parameter settings.

For a more in depth analyses of specific data, please refer to Table 4 in Pelegrina et al (2015).
The article can be downloaded here:

20 consonant letters, see section Editable Stimuli

The presented instructions are based on the e-prime script shared by Dr. Pellegrina
Instructions can be edited under section Editable Instructions

check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code 
to further customize your experiment.

The parameters you can change are: