Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.43 KB

File metadata and controls

37 lines (26 loc) · 1.43 KB

Code and Data for the article "Bistability and Affect Shift Dynamics in the Prediction of Psychological Well-Being"

Citation

Goicoechea, C., Dakos, V., Sanabria, D., Heshmati, S., Westhoff, M., Banos, O., Pomares, H., Hofmann, S. G., & Perakakis, P. (2024). Bistability and affect shift dynamics in the prediction of psychological well-being. Emotion, 25(4), 982–996. https://dx.doi.org/10.1037/emo0001454

DOI

Repository Structure

Data/               # EMA and survey data for Spanish and German samples
Code/
  01_preprocess.R   # Data cleaning and preparation
  02_extract.R      # Bistability metrics extraction (basins, affect shifts, residence times)
  05_PCA.R          # Principal Component Analysis
  06_corrplot.R     # Correlation plots
  07_lasso.R        # LASSO regression
  08_stepwiseRegression.R
  09_relativeImportance.R
  auxFunctions.R    # Helper functions (LASSO, regression, nested models)
  predictor_colors.R

Reproducibility

This project uses renv to manage R package dependencies. To reproduce the analysis environment:

# install.packages("renv")  # if not already installed
renv::restore()

This will install all required packages at the exact versions recorded in renv.lock (R 4.5.2).

Scripts are intended to be run from the project root directory.