dowhy

$npx mdskill add mkurman/zorai/dowhy

Validate causal claims using rigorous identification and refutation.

  • Tests treatment effects against confounding via back-door and IV methods.
  • Depends on pandas DataFrames and Microsoft's DoWhy library.
  • Selects causal pathways by identifying unidentifiable effects first.
  • Outputs ATE estimates with p-values and refutation test results.

SKILL.md

.github/skills/dowhyView on GitHub ↗
---
name: dowhy
description: "DoWhy (Microsoft) — causal inference library. Causal graph modeling, identification (back-door, front-door, IV), estimation (matching, IPW, double-ML), and refutation/robustness checks for causal claims."
tags: [dowhy, causal-inference, causal-graph, identification, estimation, microsoft, zorai]
---
## Overview

DoWhy (Microsoft/py-why) provides end-to-end causal inference: causal graph modeling (DAG), identification strategies (back-door, front-door, instrumental variables), estimation (linear regression, matching, IV, double-ML), and refutation tests (placebo, bootstrap, random common cause, data subset).

## Installation

```bash
uv pip install dowhy
```

## Full Workflow

```python
from dowhy import CausalModel

model = CausalModel(
    data=df,
    treatment="treatment",
    outcome="outcome",
    common_causes=["age", "gender", "income"],
)

# 1. Identify
identified = model.identify_effect(proceed_when_unidentifiable=True)

# 2. Estimate
estimate = model.estimate_effect(identified, method_name="backdoor.linear_regression")
print(f"ATE: {estimate.value:.4f} (p={estimate.p_value:.4f})")

# 3. Refute
refute = model.refute_estimate(identified, estimate, method_name="placebo_treatment_refuter")
print(f"Refutation passed: {refute.refutation_result}")
```

## References
- [DoWhy docs](https://www.pywhy.org/dowhy/)
- [DoWhy GitHub](https://github.com/py-why/dowhy)

More from mkurman/zorai

SkillDescription
account-management>
agile-scrum>
albumentationsFast image augmentation library (Albumentations). 70+ transforms for classification, segmentation, object detection, keypoints, and pose estimation. Optimized OpenCV-based pipeline with unified API across all CV tasks. Supports images, masks, bounding boxes, and keypoints simultaneously. Note: classic Albumentations (MIT) is no longer maintained; successor AlbumentationsX uses AGPL-3.0. For torchvision-native augmentations, use torchvision.transforms.v2.
aml-complianceAnti-Money Laundering (AML) and Know Your Customer (KYC) compliance workflow. Sanctions screening, PEP detection, transaction monitoring, suspicious activity reporting (SAR), and OFAC compliance.
anki-connectThis skill is for interacting with Anki through AnkiConnect, and should be used whenever a user asks to interact with Anki, including to read or modify decks, notes, cards, models, media, or sync operations.
approval-checkpoint-long-taskCanonical long-task pack for daemon-managed work with deliberate approval checkpoints, status summaries, rollback notes, and mobile-safe governance-aware updates.
auditing-goal-artifactsUse when reviewing recent zorai goal run outputs, closure markers, ledgers, or evidence bundles to judge whether completion is credible or to identify remaining uncertainty.
autogenAutoGen (Microsoft) — multi-agent conversation framework. Agent-to-agent chat, code generation & execution, tool use, group chat, and human-in-the-loop. Build collaborative AI systems with specialized agents.
backtraderPython backtesting framework for trading strategies. Data feeds, brokers, analyzers, and live trading support. Strategy development with commission models, slippage, and signal-based execution.
beautiful-mermaidRender Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.