econometrics

Estimate causal treatment effects on tabular data using OLS, propensity scores, IV, DID, and RDD.

36|6|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/xiaomihu1992/econometrics-skill --skill econometrics-xiaomihu1992
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: econometrics
Source: https://github.com/xiaomihu1992/econometrics-skill
Command: npx skills add https://github.com/xiaomihu1992/econometrics-skill --skill econometrics-xiaomihu1992

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, matplotlib, statsmodels, linearmodels, scipy, openpyxl, xlrd, and includes references (resource) components.

What problem does it solve? Answering "what is the effect of treatment T on outcome Y" requires choosing a defensible identification strategy, cleaning messy uploaded data, running the right estimator, and interpreting results with correct standard errors. This Skill packages 17 causal-inference estimators plus method-selection guidance, data diagnostics, and reporting templates so AI coding agents can run applied econometric analyses end to end. ## Core Features & Use Cases - 17 estimators across five method families: OLS with controls, propensity score methods (PSM, IPW, AIPW, IPW-RA), IV/2SLS with diagnostics, static and staggered DID with event studies, and sharp/fuzzy RDD. - Automatic data diagnostics: analyze_dataset() profiles uploaded CSV/Excel files, flags missingness, duplicates, outliers, and candidate outcome/treatment/unit/time columns, then produces cleaning recommendations. - Research-grade workflow support: references cover method selection, identification memos, diagnostic checklists, robustness grids, heterogeneity plans, and result-table generation. - Use Case: A user uploads a state-year panel dataset and asks whether a minimum-wage reform affected employment. The Skill diagnoses the data, sets up the (entity, time) MultiIndex, runs a staggered DID with cluster-robust standard errors, checks pre-trends via an event study, and reports the ATT with caveats. ## Quick Start Ask the agent to estimate the causal effect of a treatment on an outcome in your uploaded CSV or Excel file, for example: "Use the econometrics skill to run a difference-in-differences analysis of the policy reform on employment using my panel data."

Frequently Asked Questions about econometrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate a causal treatment effect from observational data in Python?

Choose an estimator based on your identifying variation: OLS with controls for conditional independence, propensity score matching or IPW for selection on observables, IV/2SLS with an instrument, DID for panel policy changes, or RDD for cutoff-based assignment. The Skill's method_selection reference maps each design to specific functions.

How to run a difference-in-differences regression with staggered treatment timing?

Set a (entity, time) MultiIndex on your panel DataFrame, then call Staggered_Diff_in_Diff_regression with the treatment dummy and cov_type="cluster_entity". Use Staggered_Diff_in_Diff_Event_Study_regression to check pre-trends and dynamic effects.

Does this Skill work with Excel and CSV files?

Yes. The load_table function reads .csv, .tsv, .xlsx, .xls, and .xlsm files via pandas, requiring openpyxl for modern Excel and xlrd for legacy .xls. The analyze_dataset function then profiles columns, missingness, and candidate variable roles automatically.

What are the known limitations of the bundled IV and AIPW estimators?

The hand-rolled 2SLS computes second-stage standard errors from predicted-treatment residuals, biasing SEs downward; use linearmodels.iv.IV2SLS for serious work. The AIPW implementation only constructs control-group counterfactuals, so it is not truly doubly robust.

When should I not use this econometrics Skill?

Do not use it for pure prediction, forecasting, time-series ARIMA, or ML model training, since it targets unbiased causal estimates rather than predictive accuracy. It also does not cover synthetic control, triple-diff, quantile treatment effects, or ML-based heterogeneity methods like Causal Forest.