Return to the Effort Expenditure for Reward Task page
___________________________________________________________________________________________________________________	

									EFFORT EXPENDITURE FOR REWARDS TASK
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 09-28-2015
last updated:  03-09-2020 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 03-09-2020 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements the Effort Expenditure for Rewards Task; a measure of reward motivation. 
The implemented procedure is based on:

Treadway MT, Buckholtz JW, Schwartzman AN, Lambert WE, Zald DH (2009) Worth the ‘EEfRT’? 
The Effort Expenditure for Rewards Task as an Objective Measure of Motivation and Anhedonia. 
PLoS ONE 4(8): e6598. doi:10.1371/journal.pone.0006598

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________	
Participants have to select between an Easy and a Hard task. Both tasks involve pressing the Spacebar for
a predetermined amount of time. The Hard task offers more money (in this script: 8 variable amounts) but is harder
and takes twice as long. Participants make their selection knowingly under 3 different win probabilities 
(aka they might not win money even if they are successful; particularly not if the win probabilities are low).
By default, E selects the Easy task and I selects the Hard task (can be edited under section Editable Parameters).

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

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

(1) Raw data file: 'effortexpenditureforrewardtask_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. 
								
practice:							0 = test; 1 = practice
counttesttrials:					counts the number of COMPLETED testtrials
Reward_easy:						the potential reward assigned to the Easy task (default: "1.00")
Reward_hard:						the currently assigned reward amount for the hard task
winprobability:						the currently assigned win probability
selectionresponse:					the key scancode of the selection response
forced:								1 = the task difficulty was randomly assigned to participant (did not choose themselves)
									0 = participant selected difficulty 
selecteddifficulty:					the task difficulty chosen/assigned: 1 = easy task; 2 = hard task
selectedtask:						"easy" vs. "hard"
selectionrt:						the latency of the selection in ms  (excludes forced choices)
countpresses:						counts the button presses of the current trial
finaltaskduration:					the duration (in ms) spent on the task (pressing buttons)
success:							1 = task was successfully completed; 0 = task was not completed
win:								1 = the successful completion is rewarded; 0 = the successful completion is not rewarded
currentreward:						the currently assigned (potential) reward amount for the task chosen
total:								stores the total of all rewards earned

	
(2) Summary data file: 'effortexpenditureforrewardtask_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)
Note:
all summary data is based on full cycles only (trial sequences that were cut short due to time constraints do not count towards summary variables)
									
randomwin1:							stores the first randomly selected win amount (in case this is used for an extra incentive)
randomwin2:							stores the second randomly selected win amount (in case this is used for an extra incentive)
total:								stores the total of all rewards earned
counttesttrials:					counts the number of testtrials
count_easy:							counts the number of easy trials (includes forced easy trials)
count_hard:							counts the number of hard trials (includes forced hard trials)
countsuccess_easy:					counts the number of successful easy trials
countsuccess_hard:					counts the number of successful hard trials
count_forced:						counts the number of times computer had to randomly select a level of difficulty for participant
meanRT_selection:					mean latency (in ms) of selection (excludes forced selections)
meantaskduration_E:					mean successful taskduration (pressing button; in ms) of the easy task
meantaskduration_H:					mean successful taskduration (pressing button; in ms) of the hard task

proportion_NonforcedHardchoices:	overall proportion of non-forced choices of the difficult task
meanRT_NonforcedHardChoices:		overall mean choice response time (in ms) for selecting difficult task (non-forced)

proportion_NonforcedHardchoices_p1:	proportion of non-forced choices of the difficult task for win probability p1 (12% chance)
meanRT_NonforcedHardChoices_p1:		overall mean choice response time (in ms) for selecting difficult task (non-forced) for win probability p1 (12% chance)

proportion_NonforcedHardchoices_p2:	proportion of non-forced choices of the difficult task for win probability p2 (50% chance)
meanRT_NonforcedHardChoices_p2:		overall mean choice response time (in ms) for selecting difficult task (non-forced) for win probability p2 (50% chance)

proportion_NonforcedHardchoices_p3:	proportion of non-forced choices of the difficult task for win probability p3 (88% chance)
meanRT_NonforcedHardChoices_p3:		overall mean choice response time (in ms) for selecting difficult task (non-forced) for win probability p3 (88% chance)
										
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

(A) Test:
- 20 minutes total: the number of trials run per participant during that timeframe depends on
	- how fast they make their selection
	- the type of task they select
	- how fast they complete the task
	(Treadway et al, 2009, p.4, only use the first 50 trials per participant for their data analyses:
	Mean trials completed = 54, SD =4.74, Range = 47–69 trials).
	
- 3 win probabilities: 88%, 50%, 12% (can be edited under section Editable List; the probabilities are 'true' probabilities and not frequencies)
- hard task reward amounts: $1.24-$4.30 (in this script: in steps of $0.43) 
		=> 8 levels (1.24,1.68,2.11,2.55,2.99,3.43,3.86,4.3; mean = 2.77)
- each level of probability (3) is paired with each level of hard task reward (8) twice within every 48 trials in this script
		=> expected money for successfully completing hard task for (every) 48 trials: $2.77 * 48 * average(0.12, 0.5, 0.88) = $66.48
		=> IF twice as many (successful) easy trials are run in the same time frame: = $1 * (2 * 48) * average(0.12, 0.5, 0.88) = $48
		=> a maximum payoff can be set in this script (if it's reached, the task is terminated)
- the presentation of the different combinations of hard reward tasks x probabilities was randomized for 2 lists of 48 trials and is presented
in fixed order to each participant (see list.rewards_hard).


Trial Sequence:
Selection Screen (max. 5000ms)*->Ready Screen (1000ms)->Task Screen (max.7s or max.21s)->success/failure feedback screen (2000ms)->potentially win screen (2000ms)

*If no selection is made within 5000ms, the computer randomly selects a task for the participant
	
(B) Practice:
- 4 trials: The first 2 trials provide the choices (Easy->Hard; if something else is chosen, the choice is "corrected");
			for the last 2 trials participants are free to choose either task.
			Reward Amounts for the Hard Task (same as for test) are selected randomly from 4 options (without replacement);
			Win probabilities (same as for test) are randomly selected (with replacement).
			In this script, practice trial provide a reminder description of the tasks for the "Ready" screen (Ready screen is presented for 2000ms)

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
The instructions are not original to Treadway et al (2009). They are provided by Millisecond Software in the form
of simple htm pages (see section Editable Instructions). The htm files can be edited directly.
Use a simple word processor like 'Notepad' to make your edits.

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

/responsekey_easy:					the response key for the Easy selection (default: "E" => left response key)
/responsekey_hard:					the response key for the Hard selection (default: "I" => right response key)

/Reward_easy:						the potential reward assigned to the Easy task (default: "1.00")

/completetaskduration:				the duration of the completed task in ms (default: 1200000) -> 20min
/selectionwindow:					the max. response window to make the task selection in ms (default: 5000)
/readyduration:						the duration of the Ready screen in ms (default: 1000)
/easyduration:						the max. duration of the Easy task in ms (default: 7000)
/hardduration:						the max. duration of the Hard task in ms (default: 21000)
/successfeedbackduration:			the duration of the feedback screen regarding success/failure in ms (default: 2000)
/winfeedbackduration:				the duration of the feedback screen regarding the reward money won in ms (default: 2000)

/easypresses:						number of button presses for the Easy task (default: 30)
/hardpresses:						number of button presses for the Hard task (default: 100)

/maxPayOff:							default: ""; no maximum payoff is set
									If set to a number, then the script terminates when that number is reached