causalis.scenarios.did.dgp.PanelOutputPanelOutput
None
Python Docs
causalis
Package entry
causalisRoot package overview and namespace mapNamespaces
causalis.scenarios.did.dgpSubmodule causalis.scenarios.did.dgp with no child pages and 4 documented members.
Functions
Jump directly into the documented functions for this page.
Data
Jump directly into the documented data for this page.
causalis.scenarios.did.dgp.PanelOutputNone
causalis.scenarios.did.dgp.generate_did_gamma_26Generate a staggered-adoption Gamma DID panel for CSA estimators.
The returned panel is long-format with absorbing treatment, multiple
first-treatment cohorts, never-treated controls, baseline-compatible
covariates, cluster labels, and optional oracle counterfactual/effect
columns. It is intended to be consumed directly by
:class:causalis.scenarios.did.model.CallawaySantAnnaDID.
Parameters
Random seed for reproducibility.
If True, returns a :class:PanelDataDID contract; if False, returns a raw :class:pd.DataFrame.
Whether to include ground-truth columns (e.g., y_cf, tau_mean_true).
Number of units that will eventually receive treatment.
Number of never-treated units.
Number of periods before any treatment starts. Defaults to 24.
Number of periods after the first treatment cohort starts. Defaults to 8.
Number of distinct treatment-start times (cohorts) among treated units.
Base treatment effect as a fraction of the counterfactual outcome.
The rate at which the treatment effect grows or decays per period after start.
Standard deviation of unit-level treatment effect multipliers.
Strength of a differential trend between treated and control units (0 = parallel).
The starting period string for the pandas index.
The pandas frequency alias (e.g., “M”, “W”, “D”).
Prefix for treated unit IDs.
Prefix for control unit IDs.
Reserved for future parameters.
Returns
The generated panel dataset.
Examples
Generate default panel data
Notes
The DGP simulates a complex business environment where the outcome Yit (e.g., revenue) follows a Gamma distribution:
The mean μit is decomposed into a counterfactual μit(0) and a treatment effect τit:
The counterfactual mean μit(0) is modeled as a product of exposure, conversion rate, and average order value (AOV), each subject to macro-economic cycles, seasonality, and unit-level trends:
where each component follows an AR(1) process with latent confounding. The treatment effect τit for a unit i treated at time Gi is:
where Ramp(⋅) is an exponential adoption curve and ηi is unit-level heterogeneity. Parallel trend violations are introduced by adding a differential linear trend to treated units’ counterfactuals.
Canonical target
causalis.scenarios.did.dgp.generate_did_gamma_26
Sections
causalis.scenarios.did.dgp.generate_staggered_did_gamma_26None
causalis.scenarios.did.dgp.__all__[‘generate_did_gamma_26’, ‘generate_staggered_did_gamma_26’]