Did Causal Analysis

Difference-in-Differences causal analysis to identify demographic drivers of behavioral changes with p-value significance testing. Use for event effects, A/B testing, or policy evaluation.

49 stars 5 forksTesting & QA

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add UCSB-NLP-Chang/Skill-Usage --skill did_causal_analysis
Manual install
git clone --depth 1 https://github.com/UCSB-NLP-Chang/Skill-Usage.git /tmp/Skill-Usage
mkdir -p ~/.claude/skills
cp -r /tmp/Skill-Usage/tasks/trend-anomaly-causal-inference/environment/skills/did_causal_analysis ~/.claude/skills/did_causal_analysis

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Difference-in-Differences Framework

DiD framework for causal inference with automatic method selection (Multivariate vs Univariate) based on sample size.

## Methodology

### Intensive Margin
- **Definition**: How much behavior changed among participants (continuous outcome)
- **Data Structure**: Sparse data - only entities that participated (made purchases, had events, etc.)
- **Outcome**: Continuous (e.g., spending amount per purchaser)
- **Key Point**: Do NOT include non-participants or create complete grids - only analyze actual participants

### Extensive Margin  
- **Definition**: How many people changed behavior (binary 0/1 outcome)
- **Data Structure**: Complete panel - all entities × all periods (includes non-participants)
- **Outcome**: Binary (0/1 indicating participation)
- **Key Point**: MUST include non-participants to measure adoption ratess

### Regression Methods

Both methods use: `Y = α + βX + γPost + δ(X × Post) + ε` where δ is the DiD estimate.

**Multivariate Heterogeneous DiD**
- Estimates ALL features simultaneously in one regression
- Controls for confounding between features
- Used when: `n ≥ k × min_sample_ratio` (default: 10k samples minimum)

**Univariate DiD**
- Separate regression for EACH feature
- More robust with small samples
- Used when: Insufficient sample size, or as fallback

**CRITICAL**: Both use statsmodels regression to provide p-values for statistical inference.

## ⚠️ CRITICAL: Data Preparation Requirements
Read the full skill on GitHub

Details

Skill name
did_causal_analysis
Path
tasks/trend-anomaly-causal-inference/environment/skills/did_causal_analysis/SKILL.md
Repo updated
8 April 2026

FAQ

What does the Did Causal Analysis skill do?

Difference-in-Differences causal analysis to identify demographic drivers of behavioral changes with p-value significance testing. Use for event effects, A/B testing, or policy evaluation.

How do I install the Did Causal Analysis skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add UCSB-NLP-Chang/Skill-Usage --skill did_causal_analysis. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Did Causal Analysis popular?

It lives in UCSB-NLP-Chang/Skill-Usage, which has 49 GitHub stars and 5 forks.

Related skills

Pubchem Database

49

UCSB-NLP-Chang/Skill-Usage

Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). Search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics.

Databases

Pymatgen

49

UCSB-NLP-Chang/Skill-Usage

Materials science toolkit. Crystal structures (CIF, POSCAR), phase diagrams, band structure, DOS, Materials Project integration, format conversion, for computational materials science.

Research & Science

Rdkit

49

UCSB-NLP-Chang/Skill-Usage

Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom sanitization, specialized algorithms.

Frontend & Design

Excitation Signal Design

49

UCSB-NLP-Chang/Skill-Usage

Design effective excitation signals (step tests) for system identification and parameter estimation in control systems.

Testing & QA

Browser Testing

49

UCSB-NLP-Chang/Skill-Usage

VERIFY your changes work. Measure performance, CLS. Use BEFORE and AFTER making changes to confirm fixes. Includes ready-to-run scripts: measure-cls.ts, detect-flicker.ts

Testing & QA

Testing Python

49

UCSB-NLP-Chang/Skill-Usage

Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.

Testing & QA

Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.