Iv Diagnosticsのロゴ

Iv Diagnostics

コミュニティ
isitcredible
iv-diagnostics

Diagnostics for instrumented specifications: first-stage strength at the design's inference level, reduced form, weak-instrument-robust inference, exclusion threats, and omitted-variable-bias sensitivity on the exclusion restriction. Invoke from `code-and-data` whenever any target specification uses an instrument. Strength is not exogeneity.

概要

公開者isitcredible
リポジトリresearch_skills
スキル名iv-diagnostics
スター
40
フォーク
6
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    isitcredibleがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルIv DiagnosticsをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/isitcredible/research_skills/tree/main/review/modules/iv-diagnostics
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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/iv-diagnostics .claude/skills/iv-diagnostics
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでIv Diagnosticsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にIv Diagnosticsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Iv Diagnosticsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

IV diagnostics

Test the two claims an instrument makes — strength and exclusion — as separate claims. Papers lead with the first-stage F because it is easy to make large, but IV identification stands or falls on the exclusion restriction, and exclusion needs its own evidence: a large first-stage statistic proves nothing about it.

Trigger: any instrumented specification among the target results. If no target specification is instrumented, this skill is NOT_APPLICABLE — do not run IV diagnostics on an OLS paper to fill a checklist.

Core checks — run for every instrumented target

  • First stage, with inference at the level the instrument actually varies. An instrument that varies at the region level clustered at the unit level has an overstated first stage; report the cluster count at the instrument-variation level — nominal G AND the partial-leverage effective count G* (../../references/methods/mackinnon_nielsen_webb_2023_few_clusters.md), since leverage imbalance is what the F counts wrong.
  • Collapse the instrument to its genuine values (the point estimate, not just the cluster count). Clustering at the instrument-variation level repairs the first-stage's precision and leaves the estimate untouched. Where the instrument is donor-substituted, interpolated, or otherwise constant within a coarser unit, drop-to-source (or average genuine replicates) and re-read the first-stage F and the 2SLS coefficient: an F that collapses is lost identification, and the estimate bends toward OLS under the weak instrument. See ../../references/design-matrix.md, "Collapse-test record".
  • The IV-precision sanity check. The analogous-OLS comparison is a free diagnostic: with homoskedastic SEs on the same sample, 2SLS cannot beat OLS on precision, so a 2SLS standard error below the comparable OLS SE under clustering suggests the clustered variance collapsing under leverage (a dominant cluster's residuals set the whole CV1 meat) rather than extra precision. Robust/clustered SEs carry no such ordering, so it is a tell, not proof: re-read both SEs under CV3/jackknife first, and escalate if the ordering survives only under CV1; do not let the table read "IV is more precise than OLS" (see the few-clusters crib's Hansen 2026 section).
  • Reduced form. The outcome regressed on the instrument directly. If the reduced form is fragile, the IV estimate is fragile no matter what the two-stage output says. And probe confounding on the reduced form, not the structural equation: the exclusion restriction is about the instrument, so "is the IV confounded by X" is tested as instrument→outcome with X controlled — not endogenous→outcome.
  • Weak-instrument-robust inference — an Anderson–Rubin confidence set or equivalent, reported beside the conventional interval. If the robust set is unbounded or much wider, that is the finding. Under a weak first stage (MOP effective F below its critical value, or below the claim-matched threshold in the weak-IV guides crib, whichever the claim needs) the 2SLS point and t-interval are unstable under trivial spec changes: say what "the IV does" from the AR/tF set, and quote a 2SLS point only from a column that reproduces exactly. When clusters are few or unequal in leverage, report the first-stage F under both the CV1 the paper prints and the CV3/jackknife variance the leverage warrants — the same instrument can read F ≈ 2,400 on CV1 and F ≈ 26 on CV3, and the honest number is the second — then pair the AR set with a tF/VtF set: critical values are a function of the first-stage F̂ and, for VtF, the null-imposed residual correlation r̂ — computed on cluster-robust inputs (CV3 SEs and a cluster-consistent first-stage F); see ../../references/methods/mackinnon_nielsen_webb_2023_few_clusters.md — the AR set inherits the cluster asymptotics that G* measures.
  • VtF on jackknife inputs — required, and not what vtf does. In any design with few or unequal clusters or shocks, the VtF set is computed from the jackknife covariance of the reduced-form and first-stage coefficients (π̂, γ̂), built from the same leave-out fits as CV3 (and, for shift-share, from the delete-one-shock fits): F̂ = γ̂²/V̂_γγ and r̂(b₀) from that matrix, critical values looked up in the authors' vtf95.mmat, the set inverted over b₀. Stata's vtf.ado cannot do this: it takes only robust or cluster() and so always returns the CR1/HC1 set. Run it only as a companion row tagged VtF-CR1-robustness; a CR1 VtF that "barely widens" the printed interval is the CR1 variance agreeing with itself, not evidence of strength. With jackknife F̂ ≤ 3.84 the VtF set is unbounded; report it so. The tool lacking the option is never a reason to skip the computation or to log it as a limitation: build it by hand from the leave-out fits. check_inference.py F6/F7 enforce this.
  • Null-imposed Anderson–Rubin sets — required, and not what boottest …, ar does. In Stata's boottest (boottest.mata, ARubin branch), the ar option sets the bootstrap DGP to the model constraints only (DGP.SetR(*pR1)), running an unrestricted wild bootstrap even though the output header prints "null imposed"; and boottest …, jk adds an (M_{gg}^{-1} − I)X_g t₁ term to the jackknife residual that vanishes only at b₀ = 0, so any non-zero null or inverted confidence set from boottest …, jk is not MNW's WCR-S. Build the AR set by hand: for each candidate b₀ on a wide grid, form the transformed outcome y_b0 = y − b₀ · endog, regress y_b0 on the instrument(s) and exogenous controls (re-absorbing fixed effects), test the instrument coefficient(s) against 0 with boottest …, jk noci (followed immediately by assert !missing(r(p))) or with the delete-one-cluster / delete-one-shock jackknife F, and bisect the grid crossings. Never report boottest's own ar or jk confidence interval as the few-cluster AR or WCR-S set; a boottest …, ar call is permitted only as a companion row tagged AR-boottest-robustness. check_inference.py F8–F10 enforce this.
  • Weak-IV statistic matched to the VCE. Under clustered or robust errors judge strength by the Montiel Olea–Pflueger effective F (check_inference.py F13 requires every iv-diagnostics report to state the MOP effective F or Effective-F: not applicable — <reason>). Just-identified with one endogenous regressor, F_eff equals the robust first-stage F and the Kleibergen–Paap rk Wald F (e(widstat) under robust/cluster()) and may be read against Stock–Yogo t-size critical values (Andrews–Stock–Sun 2019, pp. 738–739) — but a 16.38 pretest certifies only an 85% interval (Lee et al. 2022), so the inference itself comes from tF/VtF or AR. Overidentified, use MOP's bias-based critical values (τ = 10%: up to 23.1); KP is then a different statistic and neither table fits it. Cragg–Donald (e(cdid), or e(widstat) without robust/cluster()) is the i.i.d.-error statistic and is never quoted as the first-stage F of a clustered or robust model; a paper's printed F that matches Cragg–Donald while the second stage is clustered is itself a finding. When Stata's weakivtest fails or refuses an ivreghdfe / multi-way-FE fit (because weakivtest rejects absorbed FEs or ivreghdfe post-estimation), never log MOP effective F as "unavailable in the tools used": either partial out the exogenous controls and absorbed FEs from y, endog, and Z via reghdfe …, absorb(…) resid and run ivreg2 + weakivtest on the residualised variables, or compute F_eff = π̂' Q̂_ZZ π̂ / tr(Σ̂_ππ Q̂_ZZ) directly from the first-stage regression of the endogenous variable on the excluded instruments under the design's VCE (MOP 2013 eq. 3; for a single instrument this is the robust/clustered Kleibergen–Paap first-stage F). The source-audited cribs for this row: ../../references/methods/stock_yogo_2002_weak_instruments.md (i.i.d.-error bias and size critical values, and why "F > 10" is a one-cell folklore rule) and ../../references/methods/montiel_olea_pflueger_2013_weak_iv.md (the effective-F test under robust/clustered/HAC errors — the version that applies when the second stage isn't i.i.d.). The survey-level crib ../../references/methods/weak_iv_guides_andrews_stock_sun_keane_neal.md adds the claim-matched thresholds (F ≥ 50 for "2SLS beats OLS" in the archetype, F > 104.7 for exact 5% t-test size) and the contaminated-subsample warning: 2SLS SEs run artificially small precisely where the estimate is most OLS-contaminated, so an IV estimate near the OLS point estimate with a smaller SE is the signature of that failure mode, not precision. Same crib: Anderson–Rubin (or CLR) in lieu of the t-test even at strong first stages — t/Wald IV output alone is a gap whatever F says.
  • Sensitivity to plausible controls. Add the controls the exclusion story implies should be innocuous; movement in the IV estimate is evidence about exclusion, not a nuisance. The sharp version: when the paper controls a continuous confounder with coarse bins, re-run varying only that control to finer bins or continuous — if significance dies AND the first-stage F collapses, the instrument was proxying the confounder (its strength was between-bin variation). That is an exclusion red flag, not a power loss.
  • Instrument validity has a test where it applies — run it, don't assume exclusion. For a binary treatment with a discrete instrument (randomized-encouragement designs are the canonical case), the LATE identifying assumptions have testable implications: the implied complier outcome densities must be nonnegative, and Kitagawa's variance-weighted KS statistic tests this with a single instrument — no overidentifying restriction needed, so it works exactly where Sargan/Hansen is vacuous. A rejection means exclusion/monotonicity fails; a paper that asserts "the instrument is plausibly exogenous" where this test applies and does not run it has an unchecked assumption. Crib: ../../references/methods/kitagawa_2015_instrument_validity.md (scope: binary treatment, discrete instrument; Huber–Mellace and Mourifié–Wan are alternative tests for the same binary/discrete case, Mourifié–Wan with covariates — for a continuous instrument, state the gap).
  • A constructed treatment may BE the instrument. When the treatment variable was built using the instrument (or geography collinear with it — e.g. treatment attributed by where the instrument is measured), the first stage is mechanical and the just-identified 2SLS is circular: it keeps only the instrument-projected component and identifies the instrument's effect relabelled, not the treatment's. Test the conjecture, don't assert it — the RF/FS decomposition: re-estimate dropping the leverage units and report β beside its first-stage (instrument→treatment, where construction enters) and reduced-form (instrument→outcome, construction-free) components. A collapse running through the RF is a geography/ external-validity finding; through the FS, a construction artifact.
  • Leave-group-out first stages. Where the instrument's variation has natural groups (regions, cohorts, industries), re-estimate leaving each out; an instrument whose strength lives in one group is a different design from the one described.

Conditional checks — run when the trigger is present

  • Overidentification diagnostics — when multiple instruments exist. Passing overidentification tests under correlated invalidity proves little; say so if the instruments share a source.
  • Monotonicity and treatment margins — when the paper makes LATE claims: who are the compliers, and is the no-defiers assumption plausible?
  • Spatial dependence — when the instrument is geographically smooth. A smooth instrument sails through unit-level clustering untouched; apply the spatial checks from the battery's spatial record.
  • Placebo conditioning on the instrument. Diff each placebo regression's actual controls against its table note. A placebo that silently conditions on the real instrument (or a close correlate) can pass for the wrong reason — the genuine signal is partialled out. Re-run it exactly as the note describes, without the hidden control, before believing it.
  • Magnitude–validity non-separation. An implausible elasticity on a weak or placebo-leaking instrument — especially IV running above OLS — is the invalidity surfacing as a number, not a cosmetic blemish on a valid design. Never conclude "the magnitude is meaningless but the effect exists"; the defensible object is the reduced-form correlation, stated as a fact about the units, not the treatment.
  • Omitted-variable-bias sensitivity on the exclusion restriction — when identification rests on an assumed-as-good-as-random instrument. Compute the robustness value for the instrument (the iv.sensemakr approach on the Anderson–Rubin fit; formulas and the benchmarking protocol in ../../references/methods/cinelli_hazlett_2020_sensitivity.md): how strong an unobserved confounder of the instrument would have to be, benchmarked against named observed covariates, to overturn the finding. A robustness value near what a single named covariate already explains is a different finding from one no plausible confounder could reach — report which. The robustness value is NOT a verdict; it quantifies how much confounding the claim can absorb, not whether such confounding exists.

See the OVB-sensitivity record in the battery's ../../references/design-matrix.md for the required fields, and ../../references/software-examples.md for tested command patterns.

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 exclusion threats and identification findings in the module report's ## Leads for later stages (folded into the code-and-data report) for claims as design-validity evidence the moment they appear — they bear on what story the estimate can support, not only on the battery verdict.

よくある質問

AIスキル「Iv Diagnostics」では何ができますか?

Diagnostics for instrumented specifications: first-stage strength at the design's inference level, reduced form, weak-instrument-robust inference, exclusion threats, and omitted-variable-bias sensitivity on the exclusion restriction. Invoke from `code-and-data` whenever any target specification uses an instrument. Strength is not exogeneity.

TypingMindでIv Diagnosticsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Iv Diagnosticsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにIv Diagnosticsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/isitcredible/research_skills/tree/main/review/modules/iv-diagnosticsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Iv Diagnosticsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Iv Diagnosticsは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもIv Diagnosticsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Iv Diagnostics」は無料ですか?

はい。isitcredibleがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇