Analysis code and reproducibility materials for a longitudinal study of Big Five personality traits (extraversion, openness, conscientiousness) and substance use, and the moderating role of socioeconomic status (SES). Random-intercept cross-lagged panel models (RI-CLPM) are fitted to five waves of the LISS panel (Longitudinal Internet studies for the Social Sciences, administered by Centerdata, Tilburg University).
This repository intentionally contains no LISS microdata (redistribution is not permitted under the LISS data-access conditions) and no manuscript text (pending publication). Everything needed to rerun the analysis after obtaining the data from LISS is included.
R/: numbered pipeline modules (setup, income cleaning, SES, measures, CFA and invariance, sample selection, assembly and reshaping, RI-CLPM models, hypothesis tests, reporting, pipeline driver)run.R: entry point; sources the modules and defines the pipeline (no analysis runs on load)run_all.R,run_all.Rmd: render the full analysis transcriptrun_all.md: rendered transcript of a complete pipeline run, browsable at https://siardv.github.io/bigfive-substance-riclpm/full_record.R: one-shot capture of the quantities reported in the manuscript and supplement (reproduction check, SES classification stability, attrition, confidence-interval bounds)examples/workflow.R: interactive usage examples (not sourced by run.R)tables/: canonical aggregated result tables (CSV)reports/background-variables-provenance.md: provenance and handling of the LISS background-variables inputdata-checksums.md5: MD5 manifest of the exact input files useddata/,data_init/,data_merged/: data directories, tracked only as placeholders; see the README in each
LISS data are available free of charge for academic research after signing
the LISS data statement; see https://www.lissdata.nl. The exact input files
used here, with MD5 hashes, are listed in data-checksums.md5. Module
codebooks are distributed by LISS and are not mirrored in this repository.
-
Obtain the LISS files listed in
data-checksums.md5and place them indata/,data_init/, anddata_merged/as described in those directories' README files. -
Verify file integrity against
data-checksums.md5. -
From the project root, render the transcript:
Rscript run_all.RThis regenerates
run_all.mdand the tables intables/.
Developed under R 4.6.1. Packages used via :: include haven, dplyr, purrr,
tibble, lavaan, and tidyr (see the header of run.R); rendering additionally
requires rmarkdown and knitr.
Raw and person-level derived data (data/, data_init/, data_merged/,
*.sav, *.rds), the manuscript and all drafts, superseded material, and
one-off operational or manuscript-build scripts. See .gitignore for the
full policy.
Code is released under the MIT License (see LICENSE). A citation for the
accompanying manuscript will be added upon publication; CITATION.cff
covers the code in the meantime.