simulate_simple_data

cross_sectional.simulate.simulate_simple_data(
    n: int = 1000,
    *,
    treatment_effect: float = 1.0,
    treatment_share: float = 0.5,
    error_var: float = 1.0,
    seed: int | None = None,
)

Simulate a randomised experiment without covariates.

Parameters

Name Type Description Default
n int Number of units. 1000
treatment_effect float Constant shift of the treated outcome; the true QTE and ATT equal it. 1.0
treatment_share float Probability of treatment. 0.5
error_var float Variance of the error term. 1.0
seed int Seed for numpy.random.default_rng. None

Returns

Name Type Description
polars.DataFrame Columns treat and y.