interpret_coefficient
Interpret regression coefficients from OLS, Logit, and interaction models to understand variable effects in statistical analysis.
Instructions
회귀계수 해석 가이드 (OLS, Logit, 상호작용 등)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_type | Yes | 모형 유형 | |
| coefficient | Yes | 계수값 | |
| se | No | 표준오차 | |
| variable_type | No | 변수 유형 | |
| transformation | No | 변환 |
Implementation Reference
- src/tools/index.ts:1711-1732 (handler)Handler function that executes the tool logic: interprets the coefficient based on model type (OLS/linear or logit/logistic), computes odds ratio if applicable, and returns a structured interpretation with caution note.function handleInterpretCoefficient(args: Record<string, unknown>) { const modelType = args.model_type as string; const coefficient = args.coefficient as number; const variableType = args.variable_type as string; let interpretation = ""; if (modelType === "ols" || modelType === "linear") { interpretation = `X가 1단위 증가하면 Y가 ${coefficient.toFixed(3)} 단위 변화 (다른 변수 통제)`; } else if (modelType === "logit" || modelType === "logistic") { const or = Math.exp(coefficient); interpretation = `Odds Ratio = ${or.toFixed(3)}. X가 1단위 증가하면 odds가 ${((or - 1) * 100).toFixed(1)}% 변화`; } return { model_type: modelType, coefficient, variable_type: variableType, interpretation, caution: "인과적 해석은 연구설계에 따라 결정" }; }
- src/tools/index.ts:466-479 (schema)Input schema definition for the interpret_coefficient tool, specifying parameters like model_type, coefficient (required), se, variable_type, and transformation.{ name: "interpret_coefficient", description: "회귀계수 해석 가이드 (OLS, Logit, 상호작용 등)", inputSchema: { type: "object", properties: { model_type: { type: "string", description: "모형 유형" }, coefficient: { type: "number", description: "계수값" }, se: { type: "number", description: "표준오차" }, variable_type: { type: "string", enum: ["continuous", "binary", "categorical", "interaction"], description: "변수 유형" }, transformation: { type: "string", enum: ["none", "log", "standardized"], description: "변환" }, }, required: ["model_type", "coefficient"], },
- src/tools/index.ts:850-851 (registration)Registration of the interpret_coefficient tool in the handleToolCall switch statement, mapping the tool name to its handler function.case "interpret_coefficient": return handleInterpretCoefficient(args);