Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
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\*. (*accepted*). **Dorsomedial and ventromedial prefrontal cortex lesions differentially impact social influence and temporal discounting**. *PLOS Biology*. 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 # Code to run the analyses and produce figures ├─ helper_functions ├─ stan_model ``` # Installation 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. # Preparation **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`. # Model fitting **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**). # Behavioural analysis **1 - Signed Kullback–Leibler divergence (*D<sub>KL</sub>*)** 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 *D<sub>KL</sub>* 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 (**Figures 2C, 3B, 4, 5B, 6B, S3B, S4B**) 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. # Lesion analysis Please follow the `guide_to_lesion_analysis.docx` in the `lesion` folder.
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.