exercise_data.RData
exercise_data.RData
The dataset for the nine exercise sections. Generated by exercises/simulate_exercise_data.R.
The exercise scenario studies how work-related psychological states of one partner crossover to influence the other partner’s work outcomes, and how dyad-level moderators shape those pathways.
Download exercise_data.RData{.btn .btn-primary download}
Contents
| Object | Format | Dimensions | Description |
|---|---|---|---|
ddl2 |
long | 500 rows × 15 columns | One row per person |
ddw2 |
wide | 250 rows × 16 columns | One row per dyad |
Variables
Person-level (in long format ddl2)
| Variable | Type | Description |
|---|---|---|
dyad_id |
integer | Dyad identifier (1–250) |
person_id |
integer | Person within dyad (1 or 2) |
gender |
factor (male, female) |
Distinguishing variable |
affect |
numeric | Positive work-related affect |
sdt |
numeric | Self-determination at work |
job_crafting |
numeric | Proactive job-crafting behaviour |
partner_affect |
numeric | Partner’s affect |
partner_sdt |
numeric | Partner’s self-determination |
partner_job_crafting |
numeric | Partner’s job-crafting |
engagement |
numeric | Work engagement |
performance |
numeric | In-role performance |
creativity |
numeric | Creative performance |
live_together |
numeric (0/1) | Dyad lives together |
years_together |
numeric | Years as a couple |
time_spent_this_morning_together |
numeric | Minutes together this morning |
Wide-format equivalents (in ddw2)
Each person-level variable has an _a and _p version. Dyad-level moderators appear once.
Design features
Three outcomes, three crossover pathways
Each outcome has one focal partner predictor and one focal dyad-level moderator. The crossover effects are:
| Outcome | Focal partner predictor | Focal moderator | DGP interaction |
|---|---|---|---|
engagement |
partner_job_crafting |
live_together |
partner_jc × live_together = 0.15 |
performance |
partner_sdt |
years_together |
partner_sdt × years_together = 0.015 |
creativity |
partner_affect |
time_spent_this_morning_together |
partner_affect × time = 0.003 |
These focal interactions are small but detectable at N = 250 couples (500 individuals). Your likelihood ratio tests should recover them.
Within-dyad coupling
| Variable pair | Within-dyad correlation |
|---|---|
affect (predictor) |
0.30 |
sdt (predictor) |
0.30 |
job_crafting (predictor) |
0.30 |
engagement (outcome residual) |
0.25 |
performance (outcome residual) |
0.25 |
creativity (outcome residual) |
0.25 |
One non-zero gender interaction in the DGP
Out of all possible gender × predictor interactions, only one is non-zero in the data-generating process: actor_sdt × gender_male on engagement. This is the only interaction the gender-moderator LRTs should recover. The exercise 4 section asks you to check this.
Why the dataset is different from dyad_data.RData
The exercise dataset has three outcomes (not one) and three moderators (not one). This forces you to repeat your analysis pipeline for each combination, which is what you would do in a real research project. The repetition is the point.
The script number convention changes: ddl2 and ddw2 instead of ddl and ddw. This avoids name collisions when both files are loaded in the same R session.
Reproducibility
set.seed(2026) is set at the top of the simulation script. Re-running exercises/simulate_exercise_data.R will always produce the same RData file.
Loading
load("data/exercise_data.RData")
ls() # "ddl2" "ddw2"
head(ddl2, 3)
head(ddw2, 3)