User Manual: Inquisit Behavior Adaptation Task


___________________________________________________________________________________________________________________	

										BEHAVIOR ADAPTION TASK
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 10-22-2013
last updated:  09-25-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 09-25-2024 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements the Behavior Adaptation Task (BAT), a paradigm to study behavior adaption using a
a motor inhibition Go-NoGo task, as described in:

Hester, R, Simões-Franklin, C., & Garavan, H. (2007). Post-error behavior in active cocaine users: poor awareness 
of errors in the presence of intact performance adjustments. Neuropsychopharmacology, 32, 1974–1984

Millisecond Software thanks Dr. Hester et al for generously providing assistance with script development/clarifications!

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________
Participants are presented a steady paced (1hz) stream of X and Ys (one letter at the time) in the middle of the screen.
They are instructed to make a button response for each of the letters as long as the letters are alternating 
(switch from X to Y or from Y to X). Trials with alternating letters are the GO trials. 
If a letter was repeated (the alternation order interrupted), participants were instructed to withhold the response.
These trials are the NOGO trials. 

Responses to Go trials in a condition in which all NOGO trials are followed by GO trials (SL = single lure condition) 
are compared to responses to GO trials in a condition in which NOGO trials can also be followed by another NOGO trial 
(DL = double lure condition). Behavior Adaptation is thought to occur if there is a slowing down 
of responses to GO trials following single (correctly suppressed) lure NOGO trials in the DL condition 
(when another NOGO trial is possible to follow)  compared to the SL condition (when another NOGO trial is impossible).

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 15 minutes to complete

___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'behavioradaptiontask_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.
																														

blockType:						"SL": block that only runs single NoGo trials (not followed by other NoGo trials)
								"DL": block that runs a variety of single and double NoGo trials

trialType:						"go" vs. "nogo"
stimulus:						the presented target 

response:						the participant's response (scancode): 
									57 = spacebar; 
									0 = no response
									
correct:						the correctness of the response (1 = correct; 0 = otherwise)

rt: 							the latency of the response in ms (if no response values.rt = ""); measured from onset of target

responseType:					"NoGo Success" - successful suppression of response to NoGo trial
								"NoGo Failure" - failed suppression of response to NoGo trials
								"Go Anticipatory" - possible anticipatory response to Go trials (latency < parameters.anticipatoryresponse)
								"Go Success" - correct response to Go trials with latency >= parameters.anticipatoryresponse
								"Go Omission" - omission of response to Go trials
								(Note: trialtype distinction added by Millisecond Software)

countGoSL:						counts Go trials across SL Block (regardless of whether they follow a NoGo trial or not)
countNoGoSL:					counts NoGo trials across SL Block
countGoDL:						counts Go trials across DL Block (regardless of whether they follow a NoGo trial or not)
countNoGoDL:					counts NoGo trials across DL Block
countAnticipatorySL:			counts anticipatory responses for Go trials across SL Block
countAnticipatoryDL:			counts anticipatory responses for Go trials across DL Block
countFailedSuppressionsSL:		counts failed suppressions across SL Block							
countFailedSuppressionsDL:		counts failed suppressions across DL Block
countOmissionsSL:				counts omissions in across SL Block
countOmissionsDL:				counts omissions across DL Block

sumrtGoSlsl:					sum up correct latencies of GO trials that come after a single correct NOGO trial in the SL condition
countGoSlsl:					count correct GO trials that come after a single correct NOGO trial in the SL condition
sumrtGoSldl:					count correct GO trials that come after a single correct NOGO trial in the DL condition
countGoSldl:					sum up correct latencies of GO trials that come after a single correct NOGO trial in the DL condition


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

sl: block that runs only single lure NoGo trials (not followed by another Nogo trial)
dl: block that runs a variety of Nogo trials (some that are followed by another Nogo trial and some that are not)

//Accuracy: for SL and DL blocks separately:
hitRateSL:     				proportion responses in SL Go trials (include anticipatory responses)
missRateSL:					proportion omitted responses in SL Go trials
propAnticipatorySL:			proportion anticipatory responses to SL Go trials (trials that have latencies < parameters.anticipatoryresponse)

faRateSL:					proportion failed suppressions (= responses in SL Nogo Trial)
corrRejectRateSL:			proportion correct noresponses in SL Nogo Trials

zHitRateSL:					the z-score of the SL hit rate*
zFARateSL:					the z-score of the SL false alarm rate*

dPrimeSL:					Computes d' (parametric measure of discriminability btw. signals and noise)
							=> Range (in this script): 
							-5.1516586840152740479 <= dprime <= 5.1516586840152740479 (=perfect performance)
							=> The higher the value, the better signals (go stims) were overall distinguished from noise (nogo stims)
							(d' = 0: chance performance; negative d-primes: participant treated nontargets as targets and targets as nontargets)

cSL: 						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 is present (liberal response style);
							may favor faster responding in speed-accuracy trade-off response paradigms
							positive: favoring caution (conservative response style)

*Note-- *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)										
=> Adjustments are made if the  FArate (hitRate) = 0 (increased to 0.005) or 1 (decreased to 0.995)*							
							
(same for DL Block)							
							
//Response Times:
meanrtGoSlDL:				mean latency (in ms) of correct GO trials after single correct (aka suppressed) NOGO trials (single lure) in the DL condition
meanrtGoSlSL:				mean latency (in ms) of correct GO trials after single correct (aka suppressed) NOGO trials (single lure) in the SL condition

rtDiffScore:				the difference score between the two
							=> positive RT_Diffscore: slowing down in Go trials after single lures in DL condition
							(when another lure is possible) compared to Go trials after single lures in SL condition (when no other lure is possible)
																	
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________
* 2 Conditions: SL (single lure NOGO trials) vs. DL (mix of double lure and single lure NOGO trials) - tested within participant in a blocked design
* 1 experimental block per condition (tested in a blocked design; order of conditions is counterbalanced by assigned groupnumber)
	Note: number of blocks run can be edited under section EDITABLE PARAMETER (Note: Hester et al ran 3 blocks per condition)
* 314 trials per block
SL: 1 Start GO trial, 153 GO trials (that follow GO trials), 80 single NOGO trials (follow GO trials), 80 GO trials that follow NOGO trials = 314 trials
		=> order randomized
DL: 1 Start Go trial, 171 GO trials (that follow GO trials), 44 single NOGO trials (follow GO trials and are followed by a GO trial), 
	44 GO trials (follow single NOGO trials),  18 double NOGO trials (followed by another NOGO trial), 
	18 NOGO trials (follow a NOGO trial and are followed by a GO trial) and 18 GO trials (follow the double NOGO trials) = 314 trials
		=> order randomized
* 2 optional practice blocks: practice_SL - 25 trials; practice_DL - 29 trials (practice blocks added by Millisecond Software; not original)


Trial Sequence:
{target (x or y) for 800ms -> fixation cross for 200ms}	-> {target.....
Responses to a target are taken until the time the next target is presented.

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________
not original, can be edited under EDITABLE CODE -> Editable Instructions

___________________________________________________________________________________________________________________	
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:

/numberSLBlocks:						the number of consecutive SL blocks to run (default: 1)
/numberDLBlocks:						the number of consecutive DL blocks to run (default: 1)
											Notes: 
											1. Hester et al ran 3 blocks per condition
											2. Each block takes appr. 6 minutes to run
											
											
/fontSizeTarget:						fontsize of the targets in screen height percentages (default: 10%)
/fontSizeFixation:						fontsize of the fixation mark in screen height percentages (default: 3%)

/stimulusDuration:						presentation duration of the targets in ms (default: 800ms)
/fixationDuration:						presentation duration of the fixation stimulus in ms (default: 200ms)

/anticipatoryResponse:					latencies in ms in Go trials faster than this value (default: 100ms) are coded as anticipatory responses
										in this script
										
/practice:								true = practice blocks are skipped
										false = practice block are run