Tools · SPBoucher
Menu

DoWhy

by PyWhy (originally Microsoft Research) · Library

Python causal-inference library organized around model, identify, estimate and refute steps, with graphical causal models for attribution, counterfactuals and root-cause analysis

MIT licenseFreeOpen sourceLocalSelf-hostable
Visit official site Compare

Link verified Nov 2, 2026

Overview

DoWhy is an open-source Python library for causal inference, started at Microsoft and now part of the PyWhy ecosystem under the MIT license. Its effect-estimation API follows four explicit steps: model the problem as a causal graph, identify the estimand with graph-based criteria and do-calculus, estimate it with potential-outcome methods (regression, matching, weighting, instrumental variables, or EconML estimators through an integration), and refute the result with falsification tests such as placebo treatments, random common causes and data subsets.

A second module, graphical causal models (GCM), fits explicit causal mechanisms at each node to support interventions, counterfactuals, attribution of anomalies and distribution changes, intrinsic causal influence and root-cause analysis. DoWhy supports Python 3.9 and later and is installed from PyPI or conda. The library makes assumptions explicit and testable, which is its main value in applied research, but it does not create identification where none exists, its estimators are simpler than dedicated packages unless EconML is attached, and the GCM module requires specifying or learning a plausible graph.

Capabilities

  • Four-step effect estimation: model, identify, estimate, refute
  • Graph-based identification using do-calculus and backdoor/frontdoor criteria
  • Refutation tests for causal assumptions
  • Graphical causal models for interventions and counterfactuals
  • Root-cause analysis and anomaly attribution
  • Integration with EconML estimators

Typical workflows

  1. Documenting identification assumptions for an observational study
  2. Root-cause analysis of a metric change in a system
  3. Robustness checks on an estimated treatment effect

Strengths

  • Makes causal assumptions explicit and testable
  • MIT licence; active PyWhy community
  • Bridges graphical models and potential outcomes

Limitations

  • Requires a specified causal graph
  • Built-in estimators are basic without EconML
  • Assumptions cannot be verified from data alone

Prerequisites

  • Python 3.9+ with NumPy, pandas and networkx

Who it is for

  • Researchers formalizing causal designs
  • Data scientists doing attribution and root-cause analysis

Alternatives & comparison

EconML specializes in heterogeneous-effect estimation and plugs into DoWhy's estimate step; statsmodels and fixest provide classical regression tools without a graphical identification layer.

  • EconML

    Python library for heterogeneous treatment-effect estimation with machine learning: double ML, doubly robust learners, causal forests, meta-learners, IV and policy learning

    Open sourceFree
  • fixest

    R package for fast estimation of OLS, GLM, Poisson, IV and difference-in-differences models with many fixed effects, clustered errors, multiple estimations and publication tables

    Open sourceFree
  • statsmodels

    Python library for estimating statistical and econometric models with R-style formulas, rich result summaries and tests: OLS, GLM, discrete choice, ARIMA, state space, VAR and more

    Open sourceFree
Compare DoWhy with its alternatives →

Sources & verification

Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.

  • License
    DoWhy LICENSE

    https://github.com/py-why/dowhy/blob/main/LICENSE

    Supports: license_spdx, source_model

    checked Nov 1, 2026
  • Official site
    DoWhy documentation

    https://www.pywhy.org/dowhy

    Supports: name, summary

    checked Nov 1, 2026
  • Repository
    py-why/dowhy

    https://github.com/py-why/dowhy

    Supports: capabilities, description, prerequisites

    README describes tasks, GCM module and Python support

    checked Nov 1, 2026
Confidence
High
Reviewed
Nov 1, 2026
Links
Verified · Nov 2, 2026

Spotted an error?

Broken link, outdated license, wrong category, or a tool that no longer exists? Tell us; reports are reviewed by the editor.

Stata

StataCorp LLC · Mathematical & statistical computing

Commercial statistical software from StataCorp widely used in economics and social science, with editions BE/SE/MP, a command language, Mata and comprehensive PDF manuals

ProprietaryPaidAcademicLocalNov 2, 2026

linearmodels

Kevin Sheppard · Econometrics & causal inference

Python package by Kevin Sheppard adding panel data, instrumental-variable, system (SUR/3SLS) and asset-pricing estimators missing from statsmodels

NCSAFreeOpen sourceLocalNov 2, 2026

arch (Python package)

Kevin Sheppard · High-frequency financial analysis

Kevin Sheppard's Python package for univariate ARCH/GARCH volatility models, bootstraps, multiple-comparison procedures, unit-root and cointegration tests

NCSAFreeOpen sourceLocalNov 2, 2026

R

R Foundation / R Core Team · Programming languages & runtimes

Language and environment for statistical computing and graphics, with the CRAN package archive and a strong base in academic statistics and econometrics

GPL-2.0-or-laterOpen sourceFreeLocalSelf-hostedNov 2, 2026

EViews

S&P Global (EViews) · Econometrics & causal inference

Commercial Windows econometrics package for time-series estimation, forecasting and macro modelling, sold as single-user, volume, University and free Student Lite editions

ProprietaryPaidAcademicLocalNov 2, 2026

gretl

gretl developers (Allin Cottrell, Riccardo Lucchetti) · Econometrics & causal inference

Free, GPL-licensed cross-platform econometrics program with a GUI, the hansl scripting language and estimators for time series, panels and limited dependent variables

GPL-3.0-onlyFreeOpen sourceLocalNov 2, 2026