parallel_trends_check
Validate parallel trends assumption in difference-in-differences analysis using visual, statistical, or placebo approaches to ensure causal inference reliability.
Instructions
DID 평행추세 검정 가이드
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pre_periods | Yes | 사전 기간 수 | |
| approach | No | 검정 방법 |
Implementation Reference
- src/tools/index.ts:1416-1427 (handler)The handler function implementing the parallel_trends_check tool. It returns guidance on parallel trends checks for DID, including visual, statistical, and placebo approaches, along with R and Stata code examples.function handleParallelTrendsCheck(args: Record<string, unknown>) { return { pre_periods: args.pre_periods, approaches: { visual: "사전 기간 처치/통제 그룹 추세 비교 그래프", statistical: "사전 기간 시간×처치 상호작용항 유의성 검정", placebo: "가짜 처치 시점에서 효과 없음 확인" }, r_code: "feols(y ~ i(time, treat, ref = -1) | id + time, data)", stata_code: "reghdfe y i.time#1.treat, absorb(id time) cluster(id)" }; }
- src/tools/index.ts:281-291 (registration)Registration of the parallel_trends_check tool in the tools array, including its name, description, and input schema definition.{ name: "parallel_trends_check", description: "DID 평행추세 검정 가이드", inputSchema: { type: "object", properties: { pre_periods: { type: "number", description: "사전 기간 수" }, approach: { type: "string", enum: ["visual", "statistical", "placebo"], description: "검정 방법" }, }, required: ["pre_periods"], },
- src/tools/index.ts:284-290 (schema)Input schema for the parallel_trends_check tool, defining parameters pre_periods (required, number) and approach (string enum).inputSchema: { type: "object", properties: { pre_periods: { type: "number", description: "사전 기간 수" }, approach: { type: "string", enum: ["visual", "statistical", "placebo"], description: "검정 방법" }, }, required: ["pre_periods"],
- src/tools/index.ts:820-821 (registration)Switch case in handleToolCall that routes calls to parallel_trends_check to its handler function.case "parallel_trends_check": return handleParallelTrendsCheck(args);