Code and data for the delegated inter-temporal choice task, accompanying the manuscript:
Zhilin Su*, Mona M. Garvert, Lei Zhang, Todd A. Vogel, Jo Cutler, Masud Husain, Sanjay Manohar, & Patricia L. Lockwood*. (2025). Dorsomedial and ventromedial prefrontal cortex lesions differentially impact social influence and temporal discounting. PLOS Biology. https://doi.org/10.1371/journal.pbio.3003079
This repository contains:
root
├─ data # behavioural data and plots
├─ plots
├─ stanfit # stanfit objects
├─ lesion # lesion analysis
├─ all_lesion_patients
├─ lesion_masks
├─ mPFC_patients_only
├─ scripts # R and Stan code to run the analyses and produce figures
├─ helper_functions
├─ stan_model
All behavioural analyses were performed using R (v4.2.1) in RStudio (v2023.06.2). Installation guides can be found at https://posit.co/download/rstudio-desktop/.
Model fitting was performed using Stan (v2.32) and the RStan (v2.21.7) package in RStudio. Installation guides can be found at https://mc-stan.org/users/interfaces/.
All these installations should only take a few minutes to complete.
0 - Data
Data for the delegated inter-temporal choice task collected through MATLAB have been extracted and aggregated into sd_data_mpfc.RData, for the subsequent analysis and modelling using R and Stan.
Other self-reported data were stored in demographics.csv and questionnaires.csv.
1 - Bayesian modelling with Stan
Run the R scripts run_ku0-model_self.R and run_ku0-model_other.R to call the corresponding Stan scripts to perform Bayesian modelling.
2 - Parameter recovery
Run the R script parameter_recovery.R to perform the process of parameter recovery for the selected model. It also generates the corresponding plot (Figure S1).
3 - Posterior predictive checks
Run the R script posterior_predictive_checks.R to perform posterior predictive checks for the selected model. It also generates the corresponding plot (Figure S2).
1 - Signed Kullback–Leibler divergence (DKL)
Run the R script kl_divergence.R to calculates the signed KL divergence by utilising posterior samples generated by the winning model.
The output files would be ku0_kld_hc.RData, ku0_kld_mpfc.RData and ku0_kld_lc.RData.
Note: To calculate the signed DKL for different groups, you may need to change the value of pop in the script.
2 - Behavioural analyses
Run the R Quarto file analysis.qmd to generate plots and conduct all the behavioural analyses included in the manuscript. The code is well-documented and should be self-explanatory.
Several linear mixed-effects models and simulation-based analyses are being used, which may extend the time needed to complete the analyses.
Please follow the guide_to_lesion_analysis.docx in the lesion folder.