Logo di Mostly Harmless Guide

Mostly Harmless Guide

Community
wentorai
mostly-harmless-guide

Replication code and guide for Mostly Harmless Econometrics methods

Panoramica

Autorewentorai
Repositoryresearch-plugins
Nome della skillmostly-harmless-guide
Stelle
294
Fork
42
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da wentorai su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Mostly Harmless Guide in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/mostly-harmless-guide
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Mostly Harmless Guide in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Mostly Harmless Guide non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Mostly Harmless Guide non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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

Domande frequenti

Cosa fa la skill IA Mostly Harmless Guide?

Replication code and guide for Mostly Harmless Econometrics methods

Perché usare Mostly Harmless Guide su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Mostly Harmless Guide è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Mostly Harmless Guide in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/mostly-harmless-guide. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Mostly Harmless Guide?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Mostly Harmless Guide?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Mostly Harmless Guide: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Mostly Harmless Guide è gratuita?

Sì. È pubblicata su GitHub da wentorai con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇