View source: R/generate_data.R
gen_dgp_mult_periods | R Documentation |
Generate panel data where units adopt treatment at different times across three periods.
gen_dgp_mult_periods(size, dgp_type = 1)
size |
Integer. Number of units to simulate. |
dgp_type |
Integer in {1,2,3,4}. 1 = both nuisance functions correct; 2 = only the outcome model correct; 3 = only the propensity-score model correct; 4 = both nuisance functions misspecified. |
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
Unfeasible (oracle) event-study parameter at time 0.
Proportion of units with cohort == 2
and eligibility in period 1.
Proportion of units with cohort == 3
and eligibility in period 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.