causal_design_guide
Guide users through causal inference design selection and implementation for methods like DID, RDD, IV, PSM, and synthetic control, covering identification, assumptions, and practical application.
Instructions
인과추론 설계 가이드 (DID, RDD, IV, PSM, Synth)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| design | Yes | 인과추론 설계 | |
| aspect | No | 가이드 측면 |
Implementation Reference
- src/tools/index.ts:1387-1414 (handler)The handler function that implements the logic for the causal_design_guide tool. It takes input 'design' and returns a predefined guide containing identification strategy, key tests, threats, and code snippets for specified causal designs (did, rdd, iv).function handleCausalDesignGuide(args: Record<string, unknown>) { const design = args.design as string; const guides: Record<string, any> = { did: { identification: "Parallel Trends Assumption", key_tests: ["Pre-trend test", "Placebo test", "Event study"], threats: ["Anticipation", "Spillover", "Composition change"], stata: "did_imputation, csdid, reghdfe", r: "did, fixest::feols" }, rdd: { identification: "Local randomization at cutoff", key_tests: ["McCrary density test", "Covariate balance at cutoff"], threats: ["Manipulation", "Compound treatment"], stata: "rdrobust", r: "rdrobust, rdd" }, iv: { identification: "Exclusion restriction + Relevance", key_tests: ["First-stage F (>10)", "Overidentification (Sargan/Hansen)"], threats: ["Weak instruments", "Invalid exclusion"], stata: "ivreg2, ivregress", r: "ivreg, fixest::feols" } }; return { design, guide: guides[design] || { message: "Design guide not found" } }; }
- src/tools/index.ts:262-280 (registration)Registers the causal_design_guide tool in the tools array, including its name, description, and inputSchema with required 'design' parameter (enum of causal methods) and optional 'aspect'.name: "causal_design_guide", description: "인과추론 설계 가이드 (DID, RDD, IV, PSM, Synth)", inputSchema: { type: "object", properties: { design: { type: "string", enum: ["did", "rdd", "iv", "psm", "synthetic_control", "event_study"], description: "인과추론 설계" }, aspect: { type: "string", enum: ["identification", "assumptions", "implementation", "threats", "all"], description: "가이드 측면" }, }, required: ["design"], }, },
- src/tools/index.ts:264-279 (schema)Defines the input schema for the causal_design_guide tool, specifying an object with 'design' (required, enum of causal designs) and optional 'aspect' (enum of guide aspects).inputSchema: { type: "object", properties: { design: { type: "string", enum: ["did", "rdd", "iv", "psm", "synthetic_control", "event_study"], description: "인과추론 설계" }, aspect: { type: "string", enum: ["identification", "assumptions", "implementation", "threats", "all"], description: "가이드 측면" }, }, required: ["design"], },