Logo de Mostly Harmless Guide

Mostly Harmless Guide

Comunidade
wentorai
mostly-harmless-guide

Replication code and guide for Mostly Harmless Econometrics methods

Visão geral

Publicado porwentorai
Repositórioresearch-plugins
Nome da habilidademostly-harmless-guide
Estrelas
294
Forks
42
Arquivos incluídos
Somente instruções
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Completa em si mesma

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por wentorai no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Mostly Harmless Guide no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/mostly-harmless-guide
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse 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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Mostly Harmless Guide em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Mostly Harmless Guide automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Mostly Harmless Guide não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo 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

Perguntas frequentes

O que a habilidade de IA Mostly Harmless Guide faz?

Replication code and guide for Mostly Harmless Econometrics methods

Por que usar Mostly Harmless Guide no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Mostly Harmless Guide é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Mostly Harmless Guide no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/mostly-harmless-guide. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Mostly Harmless Guide?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Mostly Harmless Guide?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Mostly Harmless Guide com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Mostly Harmless Guide é gratuita?

Sim. A habilidade é publicada no GitHub por wentorai sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇