The Competition Dynamics of Approach and Avoidance Motivations Following Interpersonal Transgression
This repository contains the data and code reported in the paper authored by Bo Shen, Yang Chen, Zhewen He, Weijian Li, Hongbo Yu, and Xiaolin Zhou "The Competition Dynamics of Approach and Avoidance Motivations Following Interpersonal Transgression". In this study, we are interested in testing the approach-avoidance behavioral conflict in a transgressor after interpersonal harm. The analyses were conducted using R. Data files: There are two data files, the binary choice dataset named "allsubjdat.RData" and the dataset combined with mouse trajectories named "allsubjmstrckdat.RData". Codes:
Steps to reproduce
In order to reproduce the figures, you have to: Step 1. Install R on your computer, please follow this link to install the updated version of R on your device https://www.r-project.org/ Step 2. Install R-Studio on your device, please follow the suggestion of this link to pick an updated version for your device https://posit.co/download/rstudio-desktop/ Step 3. If you are interested in replicating the model fitting with RStan that we used for estimating decision weights for binary choice, and the dynamics of decision weights for mouse trajectories, you need to install a compatible RStan version with R and RStudio. Please follow the suggestions in the following link https://mc-stan.org/rstan/ Step 4. Download the two data files, and update the directories into the code to match the directories on your device. Step 5. We listed the code that corresponded to the panels of figures in the paper. - Figures 2a and b: Self-reported emotions.Rmd/html - Figures 2c and d: FinalDecisions.Rmd/html - Figures 3a-c: MstrckAnalysis.Rmg/html - Figures 3d and e: Code under the folder "Bootstrapping on mouse tracking ESTPs," which contains Rmd scripts and a Matlab function - Figure 4: Circuit-Model.Rmd/html - Figure 5: Code under the folder 'tDDM'. We fitted tDDM and a standard DDM models using R scripts. Parallel computation packages reported in Maier et al., 2020 were used to facilitate the data fitting (having problem on MacOS, recommend to use Windows).