User Manual: Inquisit Emotional Attentional Blink


___________________________________________________________________________________________________________________	

									Template Attentional Blink with Images	
									Example: Emotional Attentional Blink
									(German instructions)
									
___________________________________________________________________________________________________________________	


Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 05-02-2023
last updated:  11-13-2023 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 11-13-2023 Millisecond Software

German translations provided by K. Borchert for Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements Millisecond Software's version of an Attentional Blink Procedure run with images.
In general Attentional Blink Procedures are used to study the temporary suppression of visual attention of
a target that follows a distractor stimulus.

The implemented procedure is based on the Emotional Attentional Blink Procedure described by 
Keefe & Zald (2022). Instead of erotic couple images used as Emotional distractors and
non-erotic couple images as Neutral distractors (as done by Keefe & Zald), this template script runs with 
simple spider images as 'Negative' and rose images as 'Neutral' distractor stand-ins.
Target categories in this script are cars vs chairs (as opposed to left and right tilted cities and
landscape images). Images of distractors as well as images of targets can be easily replaced
to run different target and distractor images.

*Reference*											

Keefe, J. M., & Zald, D. H. (2022). Emotional distractor images disrupt target processing in a graded manner. 
Emotion (Washington, D.C.), 22(5), 971–981. 
https://doi.org/10.1037/emo0000893

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________

Participants are presented a sequence of 23 rapidly presented images (a new image every 100ms). 
21 of these images are randomly selected images of landscapes and/or cars.
One image is either a spider (distractor type1) or a rose (distractor type2) in this template script.
A target image is presented at 5 different lags following (or preceding) the distractor image. 
In this template script the target image is either a car or a chair.
As soon as participants detect the target, they should press either the left (car) or right arrow key (chair).
The sequence will continue after a response until all images have been presented.
After all images have been presented, participants are given a perceptual awareness question about the
target (can be easily turned off via editable parameters).
___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	

each block of 40 trials takes about 2.5 min.
Practice: 2.5min
Test: 10*2.5min = 25min
---------------------------
app. 30 minutes for the default script setup

___________________________________________________________________________________________________________________	
DATA FILE INFORMATION 
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw data file: 'emotionalattentionalblink_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:					with the current subject id
group: 						with the current group id
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. 
								
blockCounter:				counts the number of blocks run in each phase
trialCounter_perblock: 		counts the number of trials run in each block

distractorCondition: 		1 = spiders ('negative'); 2 = roses ('neutral')
targetCondition:			1 = car; 2 = chair
D_position:					sequence position the distractor is presented in: 5 or 7								
								
T_lag:						the current Target lag (Lag: how many trials the target is presented after the distractor)
							-2: two trials BEFORE the distractor (one image in between)
							- 1: one trial BEFORE distractor (directly precedes distractor)
							1: one trial AFTER distractor (directly follows distractor)
							2: two trials AFTER distractor (one image in between)
							8: eight trials AFTER distractor (seven images in between)
							
T_position:					the sequence position the target is presented in

D_Onset_inms:				the calculated onsettime (in ms) of the distractor
T_Onset_inms:				the calculated onsettime (in ms) of the target

corrResponse:				the correct key to press for the current trial (scancode)

//built-in (automatically recorded for each data recording trial)							
response:					the response of participant (SCANCODE of response button) in the current trial
							
							trial.imageSequence:
								203: left arrow
								205: right arrow
							trial.perceptualAwareness: IMPORTANT!!! scancodes of numbers are confusing 
							(column responseText stores the actual response key pressed)
								2: participant pressed key "1" (see column responseText)
								3: participant pressed key "2" (see column responseText)
								4: participant pressed key "3" (see column responseText)								
								5: participant pressed key "4" (see column responseText)

responseText: 				stores the label of the response key pressed (as opposed to its scancode)
																				
correct:					correctness of response in the current trial
							trial.imageSequence:
							1 = correct response key was pressed (regardless of when in the sequence)
							0 = anything else
							
latency:					response latency (in ms); measured from onset of trial

//custom latency variable-calculated in trial.imageSequence
RT:							the difference in ms 'latency - actual target onsettime'
							=> response time (in ms) measured from onset of target
								=> neg: response was made before target was presented
								=> pos: response was made after target was presented
								
validRT:					0 = the response time (if any) is not valid (either no response, response made before target, or response is anticipatory)	
							1 = response is valid: response was made after targetonset AND not within anticipatoryRT range (here: 200ms)

							
adjACC:						the adjusted accuracy of the given response depending on values.RT	
							trial.imageSequence:
							1 = correct response key was pressed for the current target (correct classification) AND
							response key was pressed 200ms+ AFTER targetonset (response is not considered anticipatory)						
							0 = anything else						
							
/////////debug variables:
//selected indices
distractorIndex:				the selected distractor itemnumber -> see item.distractors1/distractors2
targetIndex:					the selected target itemnumber -> see item.targets1/targets2
filler1Index to filler21Index: 	the selected target itemnumber -> see item.fillers

//the following variables store the assigned onsettimes.
//they will NOT be printed in order
D_Onset_inms:					the calculated onsettime (in ms) of the distractor
T_Onset_inms:					the calculated onsettime (in ms) of the target
F1_Onset_inms:					the calculated onsettimes (in ms) of the filler1 to filler21
Note: each of these 23 images should have an onsettime covering 0-2200ms								
																

(2) Summary data file: 'emotionalattentionalblink_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)		

//////////////////////////////
////////Summary Data//////////
//////////////////////////////

!IMPORTANT!
Summary data are only provided if number of Distractor Conditions <= 2 AND
number of target lags <= 5. In any other case, the script currently skips block.trimmRTs (which calculates
summary variables). However, feel free to manually change the code in 'data_cleaning_sd.iqx'
to accomodate the additional cells in your design.

////Accuracy:///////
For the following descriptive statistics, correct responses are:
- correct response key was pressed for the current target (correct classification) AND
response key was pressed 200ms+ AFTER targetonset (anything else is either a no response, a wrong response
or classified as an anticipatory response)	

//proportion correct (based on all responses - no outliers removed)
propCorrect:				overall proportion correct responses

///Main Effects:
propCorrect_IV11:			proportion correct responses for Distractor Condition 1 (here: Spiders standing in for 'Negative' emotional stimuli)
propCorrect_IV12:			proportion correct responses for Distractor Condition 2 (here: Roses standing in for 'Neutral' emotional stimuli)

propCorrect_IV21:			proportion correct responses for Target Lag Condition 1 (here: -2)
propCorrect_IV22:			proportion correct responses for Target Lag Condition 2 (here: -1)
propCorrect_IV23:			proportion correct responses for Target Lag Condition 3 (here: 1)
propCorrect_IV24:			proportion correct responses for Target Lag Condition 4 (here: 2)
propCorrect_IV25:			proportion correct responses for Target Lag Condition 1 (here: 8)

///Interactions:
propCorrect_IV11_IV21:		proportion correct responses for trials that presented a Negative stim (here: spider) as a distractor and a target with lag -2
propCorrect_IV11_IV22:		proportion correct responses for trials that presented a Negative stim (here: spider) as a distractor and a target with lag -1
propCorrect_IV11_IV23:		proportion correct responses for trials that presented a Negative stim (here: spider) as a distractor and a target with lag 1
propCorrect_IV11_IV24:		proportion correct responses for trials that presented a Negative stim (here: spider) as a distractor and a target with lag 2
propCorrect_IV11_IV25:		proportion correct responses for trials that presented a Negative stim (here: spider) as a distractor and a target with lag 8
propCorrect_IV12_IV21:		proportion correct responses for trials that presented a Neutral stim (here: rose) as a distractor and a target with lag -2
propCorrect_IV12_IV22:		proportion correct responses for trials that presented a Neutral stim (here: rose) as a distractor and a target with lag -1
propCorrect_IV12_IV23:		proportion correct responses for trials that presented a Neutral stim (here: rose) as a distractor and a target with lag 1
propCorrect_IV12_IV24:		proportion correct responses for trials that presented a Neutral stim (here: rose) as a distractor and a target with lag 2
propCorrect_IV12_IV25:		proportion correct responses for trials that presented a Neutral stim (here: rose) as a distractor and a target with lag 8

////Reaction Times (in ms):///////
For reaction times measures, only response times for correct responses are reported.
Reaction Times are reported overall, for main IVs 'Distractor Condition' (2 levels)
and Target Lags (5 levels), and interactions of the two main IVs.

The script calculates
- uncorrected Reaction Times (RT): no outlier removal
- corrected Reaction Times (RT): with outlier removal.
	Removal Algorithm: 
	Steps: done for each of the 10 conditions (2 Distractor Conditions x 5 Target Lags)
	1) calculate the mean and SD (standard deviation) for each condition separately
	2) trimm RTS from each condition that:
	mean - 2.5*SD <= RT <= mean + 2.5*SD 
	(2.5 = number of standarddeviations away from the mean)
	
******uncorrected correct RT (all response times for correct responses: NO outliers removed)*****
meanCorrRT:					overall response time (in ms) for correctly classifying the presented target

meanCorrRT_IV11:			response time (in ms) for correctly classifying the presented target with Negative distractors (here: spider)			
meanCorrRT_IV12:			response time (in ms) for correctly classifying the presented target with Neutral distractors (here: roses)

meanCorrRT_IV21:			response time (in ms) for correctly classifying the presented target with lag -2
meanCorrRT_IV22:			response time (in ms) for correctly classifying the presented target with lag -1
meanCorrRT_IV23:			response time (in ms) for correctly classifying the presented target with lag 1
meanCorrRT_IV24:			response time (in ms) for correctly classifying the presented target with lag 2
meanCorrRT_IV25:			response time (in ms) for correctly classifying the presented target with lag 8

meanCorrRT_IV11_IV21:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag -2
SD_IV11_IV21:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag -2
meanCorrRT_IV11_IV22:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag -1
SD_IV11_IV22:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag -1
meanCorrRT_IV11_IV23:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag 1
SD_IV11_IV23:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag 1
meanCorrRT_IV11_IV24:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag 2
SD_IV11_IV24:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag 2
meanCorrRT_IV11_IV25:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag 8
SD_IV11_IV25:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag 8

meanCorrRT_IV12_IV21:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag -2
SD_IV12_IV21:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag -2
meanCorrRT_IV12_IV22:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag -1
SD_IV12_IV22:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag -1
meanCorrRT_IV12_IV23:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag 1
SD_IV12_IV23:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag 1
meanCorrRT_IV12_IV24:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag 2
SD_IV12_IV24:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag 2
meanCorrRT_IV12_IV25:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag 8
SD_IV12_IV25:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag 8
	
	
*****corrected correct RT (all response times for correct responses: OUTLIERS REMOVED)******
tr_meanCorrRT:					overall response time (in ms) for correctly classifying the presented target

tr_meanCorrRT_IV11:			response time (in ms) for correctly classifying the presented target with Negative distractors (here: spider)			
tr_meanCorrRT_IV12:			response time (in ms) for correctly classifying the presented target with Neutral distractors (here: roses)

tr_meanCorrRT_IV21:			response time (in ms) for correctly classifying the presented target with lag -2
tr_meanCorrRT_IV22:			response time (in ms) for correctly classifying the presented target with lag -1
tr_meanCorrRT_IV23:			response time (in ms) for correctly classifying the presented target with lag 1
tr_meanCorrRT_IV24:			response time (in ms) for correctly classifying the presented target with lag 2
tr_meanCorrRT_IV25:			response time (in ms) for correctly classifying the presented target with lag 8

tr_meanCorrRT_IV11_IV21:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag -2
tr_SD_IV11_IV21:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag -2
tr_meanCorrRT_IV11_IV22:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag -1
tr_SD_IV11_IV22:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag -1
tr_meanCorrRT_IV11_IV23:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag 1
tr_SD_IV11_IV23:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag 1
tr_meanCorrRT_IV11_IV24:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag 2
tr_SD_IV11_IV24:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag 2
tr_meanCorrRT_IV11_IV25:		response time (in ms) for correctly classifying the presented target with with Negative (spiders) distractors and lag 8
tr_SD_IV11_IV25:				standard deviation (in ms) for response times for correctly classifying the presented target with with Negative (spiders) distractors and lag 8

tr_meanCorrRT_IV12_IV21:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag -2
tr_SD_IV12_IV21:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag -2
tr_meanCorrRT_IV12_IV22:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag -1
tr_SD_IV12_IV22:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag -1
tr_meanCorrRT_IV12_IV23:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag 1
tr_SD_IV12_IV23:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag 1
tr_meanCorrRT_IV12_IV24:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag 2
tr_SD_IV12_IV24:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag 2
tr_meanCorrRT_IV12_IV25:		response time (in ms) for correctly classifying the presented target with with Neutral (roses) distractors and lag 8
tr_SD_IV12_IV25:				standard deviation (in ms) for response times for correctly classifying the presented target with with Neutral (roses) distractors and lag 8

+ number of removed items per cell							
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

(1) Practice: 20 trials (can be easily edited under section Editable Parameters)
- practice procedure the same as for a test block but with added feedback

(2) Test: 10 block of 40 trials each
Balanced Design per each block: 
2 distractor types (negative vs. neutral) x 2 target categories (cars vs. chairs) x 2 distractor positions (5 or 7) x 5 target lags (-2,-1,1,2,8)
=> 40 trials per block, tested within participants (order of trials randomly determined)
=> 400 trials per test with 10 repetitions of each cell

*Distractor Sampling*
-the itemnumbers of the respective distractor images (per each category) are randomly selected without replacement
-the selection resets after all listed distractors in a category have been run
- the number of distractor images provided under item.distractors1/item.distractors2 determine how often a
distractor image could be repeated over all test trials

*Target Sampling*
-the itemnumbers of the respective target images (per selected target condition) are randomly selected without replacement
-the selection resets after all listed targets in a category have been run
- the number of target images provided under item.targets1/item.targets2 determine how often a
target image could be repeated over all test trials


*Trial Sequence*
-fixation cross trial: press spacebar to start next sequence (posttrialpause of 100ms)
-Image Sequence: 23 images presented at SOA= 100ms (see Editable Parameters)
	- 1 Distractor
	- 1 Target
	- 21 Filler images
- response recorded during the 2300 duration of the presentation time
- Perceptual Awareness Trial until response

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________

provided by Millisecond Software - can be edited under section 'Editable Stimuli'

distractor1-category: spiders
distractor2-category: roses

target1-category: cars
target2-category: chairs

filler images: landscape and city images

NOTES: 
(1) the images are only provided as PLACEHOLDERS
(2) these placeholder images were downloaded from https://pixabay.com/
License: Free to use under the Content License - No attribution required

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________

provided by Millisecond Software - can be edited under section 'Editable Instructions'
The instructions are modelled on an eprime script running the task that was provided to Millisecond Software
___________________________________________________________________________________________________________________	
EDITABLE CODE 
___________________________________________________________________________________________________________________	
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: