Logotipo de Synthetic Control Diagnostics

Synthetic Control Diagnostics

Comunidad
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.

Descripción general

Editorisitcredible
Repositorioresearch_skills
Nombre de la habilidadsynthetic-control-diagnostics
Estrellas
40
Forks
6
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por isitcredible en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Synthetic Control Diagnostics en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/isitcredible/research_skills/tree/main/review/modules/synthetic-control-diagnostics
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese 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
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Synthetic Control Diagnostics en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Synthetic Control Diagnostics automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Synthetic Control Diagnostics no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu 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.

Preguntas frecuentes

¿Qué hace la habilidad de IA 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.

¿Por qué usar Synthetic Control Diagnostics en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Synthetic Control Diagnostics está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Synthetic Control Diagnostics en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/isitcredible/research_skills/tree/main/review/modules/synthetic-control-diagnostics. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Synthetic Control Diagnostics?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Synthetic Control Diagnostics?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Synthetic Control Diagnostics con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Synthetic Control Diagnostics?

Sí. isitcredible la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇