Logo de Mostly Harmless Guide

Mostly Harmless Guide

Communauté
wentorai
mostly-harmless-guide

Replication code and guide for Mostly Harmless Econometrics methods

Présentation

Éditeurwentorai
Dépôtresearch-plugins
Nom de la compétencemostly-harmless-guide
Étoiles
294
Forks
42
Fichiers inclus
Instructions uniquement
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont en simple Markdown, et non en code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Tout dans les instructions

    Tout ce dont le modèle a besoin se trouve dans les instructions : aucun fichier supplémentaire à synchroniser.

  • Open source

    Publiée par wentorai sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Mostly Harmless Guide dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Collez l’URL du dossier de la compétence indiquée ci-dessous, puis confirmez.
    https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/mostly-harmless-guide
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter → Via URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wentorai/research-plugins.git /tmp/research-plugins
mkdir -p .claude/skills
cp -r /tmp/research-plugins/skills/analysis/econometrics/mostly-harmless-guide .claude/skills/mostly-harmless-guide
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Mostly Harmless Guide dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Mostly Harmless Guide dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, Mostly Harmless Guide n’est pas lié au modèle pour lequel cette compétence a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Mostly Harmless Econometrics Guide

A skill providing replication code, explanations, and practical guidance for the econometric methods presented in Angrist and Pischke's "Mostly Harmless Econometrics" (MHE). Based on the mostly-harmless-replication repository (642 stars), this skill helps researchers understand and correctly apply core causal inference techniques.

Overview

"Mostly Harmless Econometrics" is one of the most influential applied econometrics textbooks, providing accessible explanations of the methods that dominate modern empirical research in economics and increasingly in other social sciences. This skill translates the book's core methods into practical guidance that the agent can use to help researchers design studies, select appropriate estimators, and interpret results correctly.

The skill covers regression, instrumental variables, difference-in-differences, regression discontinuity, and related methods, with emphasis on the practical decisions researchers face when applying these techniques to real data.

Regression Fundamentals

Ordinary Least Squares (OLS)

  • OLS provides the best linear approximation to the conditional expectation function
  • The regression anatomy theorem: each coefficient can be obtained from a bivariate regression of the outcome on the residualized regressor
  • Omitted variable bias formula: bias equals the effect of the omitted variable times its correlation with the included regressor
  • Control variables should be selected based on the conditional independence assumption, not on statistical significance
  • Robust standard errors (Huber-White) should be the default; cluster when observations are not independent

Regression Interpretation

  • The causal interpretation of regression requires the conditional independence assumption (CIA)
  • CIA states that treatment is as good as randomly assigned after conditioning on controls
  • Saturated models (fully interacted categorical variables) are always correctly specified
  • Linear regression with continuous variables approximates the true conditional expectation
  • Report both statistical and economic significance; a large t-statistic does not mean a large effect

Practical Decisions

  • Include controls that are correlated with both the treatment and outcome
  • Do not include controls that are consequences of treatment (bad controls)
  • Use the most parsimonious specification that satisfies the CIA
  • Test sensitivity to alternative control sets to assess robustness
  • Report multiple specifications to demonstrate that results are not driven by a particular set of controls

Instrumental Variables

Core Concepts

  • IV addresses endogeneity when the treatment is correlated with unobserved factors affecting the outcome
  • A valid instrument must be relevant (correlated with treatment) and excludable (affects outcome only through treatment)
  • Two-stage least squares (2SLS) is the standard IV estimator
  • The Wald estimator (reduced form divided by first stage) gives the IV estimate in the simplest case
  • IV estimates the Local Average Treatment Effect (LATE) for compliers

Implementation Guide

  • Always report the first-stage F-statistic; values below 10 indicate weak instruments
  • Use the Anderson-Rubin test for inference robust to weak instruments
  • Over-identification tests (Sargan-Hansen) can detect violations of the exclusion restriction with multiple instruments, but cannot validate a just-identified model
  • Report the first stage, reduced form, and IV estimates together
  • Compare OLS and IV estimates; if IV is much larger, consider LATE interpretation or measurement error

Common Applications

  • Returns to education using quarter of birth as an instrument
  • Effect of institutions on growth using settler mortality as an instrument
  • Peer effects using random assignment to groups
  • Supply and demand estimation using shift variables
  • Policy evaluation using eligibility rules as instruments

Difference-in-Differences

Design Principles

  • DID compares changes in outcomes over time between treated and control groups
  • The parallel trends assumption: absent treatment, both groups would have followed the same trend
  • DID removes time-invariant unobserved confounders
  • The standard estimator is a two-way fixed effects regression (unit and time fixed effects plus treatment indicator)
  • Staggered adoption designs require careful attention to treatment timing heterogeneity

Implementation

  • Always plot pre-treatment trends to assess the parallel trends assumption visually
  • Include leads of the treatment indicator to test for pre-trends formally
  • Cluster standard errors at the group level (state, firm, school)
  • With few clusters (fewer than 50), use wild cluster bootstrap for inference
  • Consider synthetic control methods when the control group is not a natural comparator

Recent Developments

  • Callaway and Sant'Anna (2021): heterogeneity-robust DID with staggered treatment
  • Sun and Abraham (2021): interaction-weighted estimator for event studies
  • de Chaisemartin and D'Haultfoeuille (2020): decomposition of two-way FE estimator
  • Goodman-Bacon (2021): DID with variation in treatment timing decomposition
  • These methods address bias in standard two-way FE when treatment effects are heterogeneous

Regression Discontinuity

Sharp RD Design

  • Treatment is a deterministic function of a running variable at a known cutoff
  • Causal effect is identified at the cutoff by comparing outcomes just above and just below
  • Local linear regression is preferred over global polynomial fitting
  • Bandwidth selection should use data-driven methods (Imbens-Kalyanaraman, Calonico-Cattaneo-Titiunik)
  • Always show the RD plot: binned means of the outcome against the running variable

Fuzzy RD Design

  • Treatment probability jumps at the cutoff but is not deterministic
  • Fuzzy RD is analogous to IV where the instrument is being above the cutoff
  • Estimates a LATE for units whose treatment status is changed by crossing the cutoff
  • Report both the first stage (jump in treatment probability) and the reduced form (jump in outcome)
  • Validity requires that other covariates do not jump at the cutoff (density test, covariate balance)

Practical Guidance

  • Test for manipulation of the running variable using the McCrary density test
  • Show robustness to alternative bandwidth choices
  • Include covariates to improve precision but the estimate should not change substantially
  • Avoid high-order polynomial specifications that can be misleading
  • Report the effective sample size used in the local estimation

Integration with Research-Claw

This skill enhances the Research-Claw econometric analysis workflow:

  • Guide researchers in selecting the appropriate causal inference method for their question
  • Help implement estimators correctly with proper standard errors and diagnostics
  • Provide code templates for common econometric analyses in R, Stata, and Python
  • Connect with data wrangling skills for cleaning and preparing analysis datasets
  • Support writing skills with correctly formatted regression tables and result descriptions

Best Practices

  • Start by clearly stating the causal question and the source of identification
  • Draw a directed acyclic graph (DAG) to clarify assumptions about causal relationships
  • Report all relevant diagnostics (first-stage F, pre-trends, balance tests)
  • Show robustness across specifications rather than selecting a single preferred model
  • Distinguish between statistical significance, economic significance, and policy relevance
  • Be transparent about the limitations of your identification strategy

Foire aux questions

À quoi sert la compétence IA Mostly Harmless Guide ?

Replication code and guide for Mostly Harmless Econometrics methods

Pourquoi utiliser Mostly Harmless Guide sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Mostly Harmless Guide se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Mostly Harmless Guide dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/mostly-harmless-guide. TypingMind lit le fichier SKILL.md et l’installe sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Mostly Harmless Guide ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Mostly Harmless Guide ?

Autant que vous le souhaitez. Tant qu’un modèle prend en charge les compétences, vous pouvez utiliser Mostly Harmless Guide avec lui : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Mostly Harmless Guide est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par wentorai sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, modèles de documents ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇