Code and stimuli for the Willingness To Pay task used in the Devaluation study.
Originally adapted from Hutcherson et al. (2012).
runJitter.m
This script creates a vector with jitter times based on the number of trials per run. It is saved as WTP/task/input/jitter.m
. The same jitter vector is used in each run. This script only needs to be run once (or until a desired vector is achieved) per study. User inputs include:
- Number of trials in each run
runGetStim.m
This script selects images based on subject ratings, randomizes the images within each health (healthy and unhealthy) and liking (liked and disliked) category, splits the images based on the number of runs, and populates the image run folders foodpics/run1
etc. User inputs include:
- Study name
- Subject ID
- Number of runs
- Total number of trials per condition (This number must be divisible by the number of runs)
- Image ratings saved as a .csv file with the following format:
WTP/task/input/[StudyName SubjectID]_ratings.csv
e.g.DEV999_ratings.csv
runWTP.m
This script runs the task. You can specify whether the task will be run in the MRI scanner or behaviorally. User inputs include:
- Study name
- Subject ID
- Session Number (0 = practice; 1, unless a longitudinal study)
- Session type (MRI or behavioral)
runWTP_practice.m
This script runs the practice session. You can specify whether the task will be run in the MRI scanner or behaviorally. User inputs include:
- Study name
- Subject ID
- Session Number (1, unless a longitudinal study)
- Run Number (0 = practice)
- Session type (MRI or behavioral)
runAuction.m
This script runs the food auction. You'll need to update the selectfood.m
file with currently available food items. User inputs include:
- Study name
- Subject ID
- Session Number (1, unless a longitudinal study)
- Run Number (0 = practice)
- Session type (MRI or behavioral)
Files are saved to the SubjectData directory. Files are nested in the following manner:
|-- SubjectData
|-- DEV999 [StudyName SubjectID]
|-- DEV.999.1.mat [StudyName . SubjectID . Session.mat]
|-- PTBParams.999.1.mat [PTBParams . SubjectID . Session.mat]
PTBParams structure stores psychtoolbox parameters
Data structure stores the following data:
subjid
= Subject IDssnid
= Session ID (0 = practice)runid
= Run numbertime
= Date and time logStartTime
= Start time that all events are referenced fromJitter
= Cell array with fixation jitters for each trialTrialStart
= Start time for each trialISI
= Fixation duration (Jitter + specified time)FoodOn
= Absolute time when food image was flippedBidOn
= Absolute time when bid was flippedFoodOnset
= Food onset (FoodOn
-StartTime
)BidOnset
= Food onset (BidOn
-StartTime
)FoodDuration
= Duration of food imageBidDuration
= Duration of bidFoodPic
= Food image file nameFoodNum
= Food number from original listHealthCond
= Health condition (healthy or unhealthy)LikingCond
= Liking condition (liked or disliked)LikingRating
= Liking rating (collected prior to running the task)Resp
= Bid responseRT
= Bid reaction timeEndTime
= End time