Return to the Emotion N-Back Task page

						EMOTION SINGLE N-BACK TASK - with LETTERS (nonadaptive, 1-key version)

Script Author: Katja Borchert, Ph.D. ( for Millisecond Software LLC
last updated:  10-16-2019 by K. Borchert ( for Millisecond Software, LLC

Script Copyright © 10-16-2019 Millisecond Software

This script implements a basic letter n-back procedure with face emotion flankers. 
The n-back task is a go/nogo working-memory performance task with increasing levels of difficulty.

The implemented procedure is based on:

Ladouceur, C. D., Silk, J. S., Dahl, R. E., Ostapenko, L., Kronhaus, D. M., & Phillips, M. L. (2009). 
Fearful faces influence attentional control processes in anxious youth and adults. Emotion, 9(6), 855-864.

The script uses the general framework of the Inquisit Letter N-back script based on:
Ragland, J.D., Turetsky, B.I., Gur, R.C, Gunning-Dixon, F., Turner, T, Schroeder, L., Chan, R., & Gur, R.E. (2002).Working Memory
for Complex Figures: An fMRI Comparison of Letter and Fractal n-Back Tasks. Neuropsychology, 16, 370-379.

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)
In the 1-key single n-back task, participants are shown a sequence of stimuli (here: a sequence of white letters
on a black 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 'M'? If so (it's a target), and press "A". If not, don't respond.

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

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

etc. for increasing levels of N

During test trials, the center letters are flanked by:
- happy faces
- fearful faces
- neutral faces
- no faces

the default set-up of the script takes appr. 30 minutes to complete

The default data stored in the data files are:

(1) Raw data file: 'emotion_singlenbacktask_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
script.sessionid:					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. 
values.phase:					"practice" vs "test"
values.round:						counts the number of test rounds (1 round = 8 blocks) run																			
values.BlockPerRound:			the number of test blocks run within a round
values.N:						the current level N tested
values.emotion:					0 (no faces); 1 (happy); 2 (fearful), 3 (neutral)
values.starttrialcounter:			keeps track of how many start trials have been run
stimulusitem.1: 					the presented letter
values.flankerStim:				the image file of the current flanker image
values.currenttarget:				the item number of the current target

response:						the Response of the participant (scancode of response button):
											0 = no response
											31 = 'A' key (positive response)
values.responseCategory:			"Hit" vs. "Omission Error" vs. "CorrReject" vs. "Commission Error"
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 by default, editable)

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

computer.platform:				the platform the script was run on (win/mac/ios/android)
script.startdate:					date script was run
script.starttime:					time script was started
script.subjectid:					assigned subject id number
script.groupid:					assigned group id number
script.sessionid:					assigned session id number
script.elapsedtime:				time it took to run script (in ms); measured from onset to offset of script
script.completed:					0 = script was not completed (prematurely aborted); 
								1 = script was completed (all conditions run)
values.Round:					the total number of experimental blocks run

the following summary variables are only based on performance on 
(excludes trial.start even if parameters.excludeStartTrialfromPerformanceMeasure = false)

expressions.propCorrect:			overall proportion correct (across all test blocks)
expressions.meanHit_RT:			overall mean correct response time (in ms); is equal to the overall mean hit response time		

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)

expressions.hitRate_overall:		overall hit rate (across all test blocks) = hitting 'A' for targets
list.hits.itemcount:				the absolute number of target trials (across all test blocks)							
expressions.meanHit_RT:			overall mean hit response time (in ms; across all test blocks)
expressions.FArate_overall:		overall False Alarm/Commission Error Rate (across all test blocks) = hitting 'A' for nontargets
list.commissions.itemcount:		the absolute number of nontarget trials (across all test blocks)
expressions.meanFA_RT:			overall mean False Alarm response time (in ms; across all test blocks)
expressions.zhitrate_overall:		the z-score of the overall hit rate
expressions.zFArate_overall:		the z-score of the overall False Alarm rate
expressions.dprime_overall:		Computes d' (parametric measure of sensitivity):
										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)

The following variables look at the different levels of N. If a level of N was not run,
the variables will store "not run"	
expressions.hitrate_N0_nofaces:		hit rate (hitting 'A' for targets) for level N = 0, no faces
expressions.hitRT_N0_nofaces:			mean hit response time (in ms)  for level N = 0, no faces
expressions.FArate_N0_nofaces:		False Alarm/Commission Error Rate (hitting 'A' for nontargets) for level N = 0, no faces
expressions.z_hitrate_N0_nofaces:		the z-score of the hit rate  for level N = 0, no faces
expressions.z_FArate_N0_nofaces:		the z-score of the False Alarm rate for level N = 0, no faces
expressions.dprime_N0_nofaces:		Computes d' (parametric measure of sensitivity):
										The higher the value, the better targets were overall correctly distinguished 
										from nontargets (d' = 0: chance performance) for level N = 0, no faces	
(same for Level N=0-2, happy, fearful, neutral)

- After instructions, participants work through 1 block of each
- 0-back; 2-back (currently the settings are set to run them in sequence starting with a 0-back)
- default: 9 trials with 3 target trials; 6 nontarget trials 
- default: feedback is presented during practice

- 8 blocks: 2 level of N (0,2) x 4 flanker conditions (no faces, happy faces, fearful faces, neutral faces)
- 3 runs of those 8 blocks:
	* each run starts with condition N=0, no faces (see parameters.startRunWith_0backnofaces)
	* remaining 7 blocks are randomly selected

- each block runs 12 trials (+ starttrials that cannot display targets yet) => 4 target trials; 8 non-target trials
- 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

Trial Information:
- Each trial presents the letter for 500ms
- An intertrial interval (displays a fixation cross) replaces the center letter. 
Duration is randomly selected from duration starting at 3000ms to 4000ms (steps 100ms) with a mean duration of 3500 (see Editable lists)
- the response window can be set under section Editable Parameters.
CURRENTLY it's set to max.3000ms 

Face Flanker Selection:
Face stimuli are selected randomly without replacement from the current pool of face stimuli for each condition.
Repeats within one block are possible after all possible stims have been selected.
The pool of available images is reset after each block.

stimuli from NimStim set available at (Tottenham et al., 2009)

female participants: 2, 5, 6, 7, 8, 9, 13, 14, 18, and 19; 
male participants: 21, 23, 24, 27, 28, 30, 33, 37, 41, and 42) taken from the . 
All images are 800 x 600 pixels and cropped into an oval shape
(all open mouthed expressions)

The current script runs with placeholders (but uses the file names of the appropriate NimStims)

provided by Millisecond Software - can be edited under section Editable Instructions

Instructions are not original to the task. They are provided by Millisecond Software
as htm pages and simple page elements and can be edited either by changing
the provided html files or directly under Editable Instructions.

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

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:

/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, e.g. for feedback purposes (default)									
										false (0): performance during start trials that cannot be targets yet IS considered for block performance analyses (default)									
/startRunWith_0backnofaces:				true: each test round starts with 0back-no faces (default)	
										false: the different conditions are randomly sampled for each test round
/stimulusPresentationtime:					the presentation time (in ms) of the stimuli (default: 500ms)
/ startFixation:							the duration (in ms) of the fixation cross that is presented at the start of each block (default: 3500ms)

/RW:									max. response window (in ms) after onset of center letter (default: 3000ms)
										Note: the response window cannot be longer than stimulus presentation time (500) + shortest ITI (3000)

/letterSize:								proportional letter size
/fixationCrossSize:						proportional fixation cross size
/picSize:									proportional size of the flanker images
/flankerLetterSize:							proportional size of the flanker letters
/flankerLeft:								proportional position of the left flanker
/flankerRight:								proportional position of the right flanker										
debugmode = 0							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)

Copyright © Millisecond Software. All rights reserved.
Contact | Terms of Service | Privacy Statement | Security Statement | GDPR
Website Security Test