simulate_rdd_data
rdd.simulate.simulate_rdd_data(
n: int = 10000,
*,
alpha: float = 2.5,
sigma_r: float = 1.0,
sigma_0: float = 1.0,
sigma_1: float = 1.0,
sigma_d: float = 1.0,
seed: int | None = None,
)
Simulate a fuzzy RD design with heterogeneous quantile effects.
Parameters
| n |
int |
Number of units. |
10_000 |
| alpha |
float |
Size of the treatment-cost reduction at the cutoff. Larger values produce a stronger first stage. |
2.5 |
| sigma_r |
float |
Standard deviation of the running variable. |
1.0 |
| sigma_0 |
float |
Standard deviation of the untreated outcome disturbance. |
1.0 |
| sigma_1 |
float |
Standard deviation of the treatment-effect disturbance. The treatment effect is -eps_1. |
1.0 |
| sigma_d |
float |
Standard deviation of the treatment-selection disturbance. |
1.0 |
| seed |
int |
Seed for numpy.random.default_rng. |
None |
Returns
|
polars.DataFrame |
Columns running, treatment, y, y_0, y_1, d_0, d_1 and complier. |