Causalis LLM Guide
Causalis is a Python causal inference library for experiments, observational studies, panel designs, synthetic control, IV, uplift/CATE, CUPED, and robust diagnostics.
Assistant rule
Use the scenario first.
The canonical Causalis pattern is choosing the empirical design, creating the matching data contract, fitting the default estimator, then callingestimate()and diagnostics.
| Scenario | Use When | Default |
|---|---|---|
| Classic RCT CausalData | Randomized treatment-control experiment without required pre-period outcome data. | DiffInMeans |
| CUPED CausalData | Randomized experiment with pre-treatment outcome or strong pre-period covariates. | CUPEDModel |
| Unconfoundedness CausalData | Observational treatment with observed confounders and overlap. | IRM |
| Multi Unconfoundedness MultiCausalData | Observational study with multiple discrete treatment arms. | MultiTreatmentIRM |
| Difference in Difference PanelDataDID | Panel data observed before and after treatment. | CallawaySantAnnaDID |
| Synthetic Control PanelDataSCM | Aggregate-unit treatment with donor controls and strong pre-treatment fit. | AugmentedSyntheticControl |
| Instrumental Variables IVCausalData | Endogenous treatment with a credible instrument. | IIVM |
| Uplift/CATE CausalData | Individual treatment effect targeting after an IRM-style workflow. | IRM + predict_cate |
Minimal imports
from causalis.data_contracts import CausalData, MultiCausalData from causalis.scenarios.classic_rct.model import DiffInMeans from causalis.scenarios.cuped.model import CUPEDModel from causalis.scenarios.unconfoundedness import IRM from causalis.scenarios.multi_unconfoundedness import MultiTreatmentIRM data = CausalData(df=df, treatment="d", outcome="y", confounders=["x1", "x2"]) estimate = IRM().fit(data).estimate()
Data shape
CausalData: dataframe, treatment column, outcome column, confounders, optional user id.
MultiCausalData: dataframe, treatment arm names, control treatment, outcome, confounders.
PanelDataDID / PanelDataSCM: dataframe, unit column, time column, outcome, and treatment timing.
IVCausalData: dataframe, treatment, outcome, instrument names, and optional confounders.
Common mistakes
- Using IRM for randomized experiments when DiffInMeans or CUPEDModel is the simpler design match.
- Using CUPED with covariates measured after assignment.
- Calling observational estimates causal without stating unconfoundedness and overlap assumptions.
- Using DiD without checking pre-treatment panel support and trend diagnostics.
- Using synthetic control without enough pre-treatment periods or a credible donor pool.
- Guessing import paths when the API reference does not confirm them.
Conceptual comparison
DoubleML focuses on double/debiased machine learning estimators. EconML focuses on heterogeneous treatment effect estimation and policy learning. causalml focuses on uplift and causal ML workflows.
Causalis is scenario-first: experiments, CUPED, observational IRM, multi-treatment IRM, DiD, synthetic control, IV, uplift, data contracts, notebooks, diagnostics, and API docs are presented as one coherent workflow.
API ReferenceSearch/LLM entry pages
Public, crawlable guides for retrieval. They are intentionally kept out of the main navigation and article collections.