Generate panel data with staggered treatment adoption (three periods)
gen_dgp_mult_periods.RdGenerate panel data where units adopt treatment at different times across three periods.
Arguments
- size
Integer. Number of units to simulate.
- dgp_type
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.- include_covariates
Logical. If
TRUE(default), generates covariates with transformations and usesdgp_typespecification. IfFALSE, uses constant covariates and fixed propensity score probabilities for a simpler DGP.
Value
A named list with components:
- data
A
data.tablein long format with columns:id: unit identifiercohort: first period when treatment is assignedpartition: partition indicatorx1,x2,x3,x4: covariatescluster: cluster identifier (no within-cluster correlation)time: time period indexy: observed outcome
- data_wide
A
data.tablein wide format (one row perid) with columns:id,cohort,partition,x1,x2,x3,x4,clustery_t0,y_t1,y_t2: outcomes in periods 0, 1, and 2
- ES_0_unf
(Only if
include_covariates = TRUE) Unfeasible (oracle) event-study parameter at time 0.- prob_g2_p1
(Only if
include_covariates = TRUE) Proportion of units withcohort == 2and eligibility in period 1.- prob_g3_p1
(Only if
include_covariates = TRUE) Proportion of units withcohort == 3and eligibility in period 1.