Logo de Synthetic Control Diagnostics

Synthetic Control Diagnostics

Comunidade
isitcredible
synthetic-control-diagnostics

Diagnostics for synthetic control and synthetic difference-in-differences: pre-period adequacy, placebo-unit rank, weight diagnostics including lagged-outcome degeneracy, terminal-period sensitivity, and in-time placebos. Invoke from `code-and-data` whenever a target result uses a synthetic comparison unit.

Visão geral

Publicado porisitcredible
Repositórioresearch_skills
Nome da habilidadesynthetic-control-diagnostics
Estrelas
40
Forks
6
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

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

  • Sem arquivos extras

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

  • Código aberto

    Publicada por isitcredible no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Synthetic Control Diagnostics 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 abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/isitcredible/research_skills/tree/main/review/modules/synthetic-control-diagnostics
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do 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/isitcredible/research_skills.git /tmp/research_skills
mkdir -p .claude/skills
cp -r /tmp/research_skills/review/modules/synthetic-control-diagnostics .claude/skills/synthetic-control-diagnostics
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Synthetic Control Diagnostics 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 Synthetic Control Diagnostics 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, Synthetic Control Diagnostics 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á.

Synthetic-control diagnostics

Ask how the fit was achieved, how the treated unit ranks against placebos, and whether the gap survives the choice of endpoint. A synthetic control is only as good as its donor weights, and the weights can be manufactured: match on enough lagged outcomes and the fit becomes mechanical while the covariates become decoration — so a tight pre-period fit is where the questions start, not where they end.

Trigger: a synthetic control or synthetic difference-in-differences comparison behind any target result. NOT_APPLICABLE otherwise.

Method crib (source-audited): ../../references/methods/synthetic_control_guide.md — Abadie-Diamond-Hainmueller fit/placebo machinery, Ferman spec-search accounting, Kaul all-lags pathology, BMF augmentation, CWZ conformal, scpi prediction intervals, SDID. ../../references/methods/cattaneo_feng_titiunik_2021_sc_intervals.md — JASA: conditional prediction intervals on the counterfactual itself. The permutation rank test answers "is this gap unusual among placebos?", not "what is the CI on the effect?". The CFT interval is around the synthetic counterfactual: the test is whether it contains the treated unit's observed outcome. A tight rank p with a treated outcome inside the interval means the effect is not distinguishable from prediction error under CFT's assumptions — a test under rule 8 (report its power), not a correction; a wide interval that still excludes the treated outcome is not. Report the interval alongside the rank.

Core checks

  • Pre-period adequacy — and route the answer. Is the pre-treatment window long enough to discipline the fit and support the chosen inference procedure? A short pre-period plus many donors is a recipe for overfitting the fit and underpowering the test. When T0 is short relative to the donor count or the post-period, a tight pre-fit is manufactured evidence: require a penalized/augmented estimator and report the placebo grid's resolution limit; when T0 is adequate, unlock the in-time placebo and the pre-period holdout below. State the rule you applied.
  • Placebo-unit distribution and rank. Run the full procedure on every donor as if it were treated; report where the treated unit's effect ranks in that distribution. Specify the statistic: the canonical ranking is the post/pre RMSPE ratio (Abadie–Diamond–Hainmueller), not the raw gap — donors with poor pre-fit produce large mechanical gaps and contaminate the null. Screen the pool: state the treated unit's own pre-RMSPE and exclude placebos whose pre-RMSPE exceeds a stated multiple of it. Then report J and the smallest attainable p — the grid is 1/(J+1), and when that exceeds α the test cannot reject and the record is "resolution-limited, uninformative," not a null; symmetrically, a grid-minimum rank is not a clean p-value. The rank is the design-based test — a treated effect inside the screened placebo distribution is no evidence of an effect however dramatic the gap plot looks; read it beside the conformal and scpi intervals below.
  • Weight diagnostics. Report the donor weights: sparse, extreme, or degenerate weights mean the "synthetic" unit is really one or two donors, and the design inherits their idiosyncrasies. Then check those donors for their own shocks in the treatment period, run a donor leave-one-out refit (drop each positive-weight donor, report the gap range), and screen the placebo pool for donors that received similar interventions — a contaminated placebo pool shrinks the apparent rank.
  • Terminal-period sensitivity. Recompute the effect dropping the final periods; divergence that lives at the end of the sample is fragile to it.
  • Alternative-estimator refit. Re-fit the headline gap under augmented SC (Ben-Michael–Feller–Rothstein — the standard repair for imperfect pre-fit), SDID, and/or generalized SC; report whether the gap survives the estimator, not just the donor set.
  • Conformal inference. Chernozhukov–Wüthrich–Zhu conformal intervals are the second design-based inference route beside the placebo rank and scpi; where the placebo grid is coarse, conformal is often the higher-resolution test.
  • Model-based prediction intervals (scpi). The placebo rank is one inference route; scpi (Cattaneo–Feng–Palomba–Titiunik) is a second, independent one — it puts a prediction interval around the synthetic counterfactual that carries the estimator's own in-sample and out-of-sample uncertainty. Report it beside the placebo rank: a gap that ranks extreme among placebos while the treated outcome sits inside the counterfactual's scpi interval is not the clean effect the gap plot implies; a treated outcome outside a wide interval is still outside it. Re-run under alternative weight constraints (simplex, lasso, ridge, ols) and report whether the gap survives the constraint. (scpi implements this — data prep, scest, scpi, scplot; see the battery's software examples.)

Conditional checks

  • Lagged-outcome degeneracy — when lagged outcomes enter the matching variables: check whether they collapse the weights onto the outcome path, making the fit mechanical and the covariate matching irrelevant. Report the fit with and without the saturated lag set. This is a proved pathology, not a suspicion: Kaul, Klößner, Pfeifer & Schieler (2022, JBES) prove that when every pre-period outcome enters as a separate predictor, every other covariate is rendered irrelevant to the weights, however much it matters for the post-period — so a paper that "matches on covariates X, Y, Z and lagged outcomes" is usually doing lagged-outcome matching with the covariates as decoration. Read the V-weights table: structural covariates at 0.000–0.01 with a few lag years at 0.4+ is the signature. Ferman, Pinto & Possebom (2020) are routinely mis-cited: their position is a fork — use fewer lags if covariates should do work, all lags if they needn't — plus multiple specifications and combined test statistics (Imbens–Rubin), not "one alternative spec." Fixes: match on structural covariates only, set V exogenously, cross-validate V (Abadie et al.'s own recommendation), or use a method without the pathology (SDID, penalised SC, matrix completion).
  • SDID needs a large pre-period for its inference. Synthetic DiD is not SC — the ridge penalty, time weights, and jackknife inference rest on T0 → ∞ (pre-periods). With single-digit T0 the weights are underdetermined, the "flat pre-trends" are partly an overfitting artifact, and the large-N_co, large-T0 conditions behind all three variance estimators are not in force — the bootstrap (re-estimates the weights), the jackknife (fixes them; conservative only under those conditions, undefined at one treated unit) and the placebo estimator (the one-treated-unit route, which needs homoskedasticity across units). Count the pre-periods before accepting an SDID's inference; a placebo treatment date inside the pre-window converts the caveat into demonstrated instability on their numbers. But do not lead a critique with it when a coincident-shock or identification argument is available — overfitting is orthogonal to a shock with no pre-period footprint, and leading with it implicitly concedes a better-powered SDID would identify the effect.
  • In-time (backdated) placebo — when the pre-period allows it: assign a fake treatment date inside the pre-period and confirm the procedure finds nothing.
  • Pre-period holdout — the direct test of mechanical fit: reserve part of the pre-period, re-estimate the weights on the training portion only, and check whether the fitted unit tracks the held-out pre-periods. Weights that fail to extrapolate within the pre-period were fit, not found.
  • Staggered adoption or multiple treated units — use scdataMulti (scpi); pooled and unit-level results are different objects.
  • SDID time-weight concentration — for SDID targets, report the concentration of the time weights λ across pre-periods beside the donor weights, and re-estimate the SDID claim under plain DiD and SC as sensitivities.

Report back

Lead with what each check found and what it costs the claim, not a row for every check. Still account for coverage: say what you ran, what was NOT_APPLICABLE and why, and what was blocked (exact file, command, error). Record donor-composition findings in the module report's ## Leads for later stages (folded into the code-and-data report) for claims: when the synthetic unit is really one donor economy, the counterfactual claim is a comparison with that economy, and the story must survive being said that way.

Perguntas frequentes

O que a habilidade de IA Synthetic Control Diagnostics faz?

Diagnostics for synthetic control and synthetic difference-in-differences: pre-period adequacy, placebo-unit rank, weight diagnostics including lagged-outcome degeneracy, terminal-period sensitivity, and in-time placebos. Invoke from `code-and-data` whenever a target result uses a synthetic comparison unit.

Por que usar Synthetic Control Diagnostics no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Synthetic Control Diagnostics é escrita 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. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Synthetic Control Diagnostics no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/isitcredible/research_skills/tree/main/review/modules/synthetic-control-diagnostics. 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 Synthetic Control Diagnostics?

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 Synthetic Control Diagnostics?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Synthetic Control Diagnostics 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 Synthetic Control Diagnostics é gratuita?

Sim. A habilidade é publicada no GitHub por isitcredible 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, templates 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 que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: 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 lista completa

Crie seu próprio espaço de trabalho com IA agora

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