compare_methods
Compare statistical methods by analyzing their strengths, weaknesses, and application conditions to select the most appropriate approach for your research.
Instructions
여러 통계 방법 비교 (장단점, 적용조건)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| methods | Yes | 비교할 방법들 | |
| criteria | No | 비교 기준 (예: assumptions, efficiency, robustness) |
Implementation Reference
- src/tools/index.ts:1073-1104 (handler)The main handler function `handleCompareMethods` that implements the tool logic. It compares pairs of statistical methods (e.g., FE vs RE, DID vs SCM) using predefined comparison data and falls back to suggesting another tool if no predefined comparison exists.function handleCompareMethods(args: Record<string, unknown>) { const methods = args.methods as string[]; const comparison: Record<string, any> = { fe_vs_re: { methods: ["Fixed Effects", "Random Effects"], key_difference: "FE는 개체 고정효과와 X 상관 허용, RE는 비상관 가정", decision: "Hausman test: H₀ 기각 → FE, H₀ 수용 → RE (효율성)", tradeoff: "FE: 일관성 | RE: 효율성 (시간불변 변수 추정 가능)" }, did_vs_scm: { methods: ["DID", "Synthetic Control"], key_difference: "DID는 다수 처치/통제, SCM은 단일 처치 단위에 적합", decision: "처치 단위 수: 1 → SCM, 다수 → DID", tradeoff: "DID: 통계 검정 용이 | SCM: 평행추세 가정 완화" }, psm_vs_iv: { methods: ["PSM", "IV/2SLS"], key_difference: "PSM은 관찰변수 통제, IV는 비관찰 내생성 해결", decision: "Selection on observables → PSM, Selection on unobservables → IV", tradeoff: "PSM: 도구변수 불필요 | IV: 비관찰 교란 통제" } }; const methodKey = methods.sort().join("_vs_"); const result = comparison[methodKey] || { methods, message: "상세 비교를 위해 search_stats_knowledge 도구 사용을 권장합니다." }; return result; }
- src/tools/index.ts:73-92 (registration)Registration of the 'compare_methods' tool in the exported `tools` array, including its name, description, and inputSchema definition.{ name: "compare_methods", description: "여러 통계 방법 비교 (장단점, 적용조건)", inputSchema: { type: "object", properties: { methods: { type: "array", items: { type: "string" }, description: "비교할 방법들" }, criteria: { type: "array", items: { type: "string" }, description: "비교 기준 (예: assumptions, efficiency, robustness)" }, }, required: ["methods"], }, },
- src/tools/index.ts:76-90 (schema)Input schema for the 'compare_methods' tool defining the expected arguments: array of methods (required) and optional criteria.inputSchema: { type: "object", properties: { methods: { type: "array", items: { type: "string" }, description: "비교할 방법들" }, criteria: { type: "array", items: { type: "string" }, description: "비교 기준 (예: assumptions, efficiency, robustness)" }, }, required: ["methods"],
- src/tools/index.ts:789-790 (registration)Registration of the handler in the `handleToolCall` switch statement, mapping the tool name to `handleCompareMethods`.return handleCompareMethods(args); case "get_formula":