This repository contains the analysis scripts for the paper:
Evers, K., Borsboom, D., Fried, E., Hasselman, F., Bartoš, F., & Waldorp, L. (2026). Non-random patterns in the co-occurrence and accumulation of adverse life events in two national panel datasets. Communications Psychology, 4(1), 66. https://doi.org/10.1038/s44271-026-00394-y
The code is organized in the following way:
- main.R runs all analyses on the SHP and HILDA data, using the following scripts:
- setup.R loads the necessary libraries, sets up the parameters, and defines some helper functions
- prepare_data_func.R defines functions to prepare the data from SHP and HILDA for analysis
- cooccurrence_event_types.R runs the co-occurrence of adverse life event types analysis
- lagged_event_counts.R runs the lagged event counts analysis
- accumulation_event_counts.R runs the accumulation of event counts analysis
- descriptives.R calculates and plots descriptive statistics for both datasets
The resulting figures can be found in the figs folder.
The SHP data is available at https://www.swissubase.ch/en/catalogue/studies/6097/20179/overview, with instructions for download at https://forscenter.ch/projects/swiss-household-panel/data. Access to the HILDA dataset can be requested at https://dataverse.ada.edu.au/dataverse/DSSLongitudinalStudies.
For any questions, please contact Kyra Evers at kyra.c.evers@gmail.com.