simulate_covariate_data

cross_sectional.simulate.simulate_covariate_data(
    n: int = 1000,
    *,
    n_noise_covariates: int = 0,
    effect_scale: float = 1.0,
    error_var: float = 1.0,
    seed: int | None = None,
)

Simulate the fixed observational setting with covariates.

Parameters

Name Type Description Default
n int Number of units. 1000
n_noise_covariates int Number of additional noise covariates. The five covariates that enter the design are always generated, so the frame has 5 + n_noise_covariates covariate columns. 0
effect_scale float Multiplies the treatment effect sizes (the coefficients of d in the location and scale components). 1 is the original design and 0 removes the treatment effect. 1.0
error_var float Multiplies the conditional variance of both arms. 1.0
seed int Seed for numpy.random.default_rng. None

Returns

Name Type Description
polars.DataFrame Columns x0, ..., x{p-1}, treat, y and the potential outcomes y_0 and y_1.