Data
The simulated datasets that power the tutorials and exercises
Every tutorial in this site uses one of two simulated datasets. They are designed to be realistic enough to teach with — they include the messy features of real dyadic data (correlated residuals, moderation, gender mean differences) — but their data-generating parameters are known, so you can compare your estimates to the truth.
Neither dataset contains real participants. The structure emulates real studies (especially Hahn, Binnewies, & Dormann, 2014) but the numbers are fabricated. Use them to learn methods — do not use them to make claims about the world.
dyad_data.RData
The dataset for the eight core tutorials. 100 dual-earner couples, two outcomes (relationship satisfaction), two predictors (WNC, recovery), two dyad-level covariates (has_children, dual_earner), and a gender distinction.
exercise_data.RData
The dataset for the nine exercise sections. 250 couples, three outcomes (engagement, performance, creativity), three predictors (affect, sdt, job_crafting), and three moderators (live_together, years_together, time_spent_this_morning_together).
How to use these files locally
Both files are in data/ at the repository root. Load them in R with load("data/dyad_data.RData") or load("data/exercise_data.RData").
Each file is generated by a simulation script in scripts/ and exercises/. The simulation scripts document the data-generating parameters at the top of the file, and they are deterministic (set.seed()), so the data are reproducible.
Generating the data yourself
To re-generate the datasets from scratch:
# From the repository root
source("scripts/01_simulate_data.R") # writes data/dyad_data.RData
source("exercises/simulate_exercise_data.R") # writes data/exercise_data.RDataThe full Makefile also exposes a make data target that runs both scripts.
Citing the underlying empirical work
The dyad_data.RData structure emulates the design of Hahn, Binnewies, & Dormann (2014). The exercise_data.RData structure emulates crossover research in work and organisational psychology. The full citation list is in the references.