Generate panel data where units adopt treatment at different times across three periods.
gen_dgp_mult_periods(size, dgp_type = 1, include_covariates = TRUE)A named list with components:
A data.table in long format with columns:
id: unit identifier
cohort: first period when treatment is assigned
partition: partition indicator
x1, x2, x3, x4: covariates
cluster: cluster identifier (no within-cluster correlation)
time: time period index
y: observed outcome
A data.table in wide format (one row per id) with columns:
id, cohort, partition, x1, x2, x3, x4, cluster
y_t0, y_t1, y_t2: outcomes in periods 0, 1, and 2
(Only if include_covariates = TRUE) Unfeasible (oracle) event-study parameter at time 0.
(Only if include_covariates = TRUE) Proportion of units with cohort == 2 and eligibility in period 1.
(Only if include_covariates = TRUE) Proportion of units with cohort == 3 and eligibility in period 1.
Integer. Number of units to simulate.
Integer in {1,2,3,4}. Only used when include_covariates = TRUE.
1 = both nuisance functions correct (default);
2 = only the outcome model correct;
3 = only the propensity-score model correct;
4 = both nuisance functions misspecified.
Logical. If TRUE (default), generates covariates with
transformations and uses dgp_type specification. If FALSE, uses constant
covariates and fixed propensity score probabilities for a simpler DGP.