meta_code
Generate statistical code for meta-analysis in R or Stata to perform basic analysis, meta-regression, subgroup analysis, or sensitivity testing.
Instructions
메타분석 코드 생성 (metafor, meta, metan)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analysis | Yes | 분석 유형 | |
| effect_measure | No | 효과크기 지표 | |
| language | Yes | 언어 |
Implementation Reference
- src/tools/index.ts:1808-1815 (handler)The handler function for the 'meta_code' tool. It returns predefined R and Stata code snippets for meta-analysis based on the provided analysis type and language.function handleMetaCode(args: Record<string, unknown>) { return { analysis: args.analysis, language: args.language, r_code: "library(metafor)\nres <- rma(yi, vi, data = dat)\nforest(res)", stata_code: "metan effect se, random" }; }
- src/tools/index.ts:584-600 (registration)Registration of the 'meta_code' tool in the exported tools array, including name, description, and input schema definition.{ name: "meta_code", description: "메타분석 코드 생성 (metafor, meta, metan)", inputSchema: { type: "object", properties: { analysis: { type: "string", enum: ["basic_ma", "meta_regression", "subgroup", "sensitivity"], description: "분석 유형" }, effect_measure: { type: "string", description: "효과크기 지표" }, language: { type: "string", enum: ["r", "stata"], description: "언어" }, }, required: ["analysis", "language"], }, },
- src/tools/index.ts:868-869 (registration)Dispatch case in the handleToolCall switch statement that routes calls to the meta_code handler.case "meta_code": return handleMetaCode(args);