Skip to main content
Glama

generate_stata_code

Generate Stata code for statistical analysis, diagnostics, and data visualization to support quantitative research workflows.

Instructions

Stata 코드 생성 (분석, 진단, 시각화)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysis_typeYes분석 유형
variablesNo변수 정보
optionsNo추가 옵션

Implementation Reference

  • The handler function that generates Stata code templates for specified analysis types (ols, panel_fe, did) using hardcoded templates.
    function handleGenerateStataCode(args: Record<string, unknown>) { const analysisType = args.analysis_type as string; const templates: Record<string, string> = { ols: ` * OLS Regression reg y x1 x2 x3 * Robust SE reg y x1 x2 x3, robust * Diagnostics vif hettest ovtest `, panel_fe: ` * Panel Setup xtset id time * Fixed Effects xtreg y x1 x2, fe cluster(id) * Two-way FE (reghdfe) reghdfe y x1 x2, absorb(id time) cluster(id) * Hausman test xtreg y x1 x2, fe estimates store fe xtreg y x1 x2, re hausman fe `, did: ` * Basic DID gen treat_post = treat * post reg y treat post treat_post, cluster(id) * reghdfe reghdfe y treat_post, absorb(id time) cluster(id) * Event Study forvalues t = -5/5 { gen treat_t\`t' = treat * (time == event_time + \`t') } reghdfe y treat_t*, absorb(id time) cluster(id) coefplot, keep(treat_t*) ` }; return { analysis_type: analysisType, stata_code: templates[analysisType] || "* Analysis template not found" }; }
  • Tool registration in the tools array, including name, description, and input schema definition.
    name: "generate_stata_code", description: "Stata 코드 생성 (분석, 진단, 시각화)", inputSchema: { type: "object", properties: { analysis_type: { type: "string", description: "분석 유형" }, variables: { type: "object", description: "변수 정보" }, options: { type: "object", description: "추가 옵션" }, }, required: ["analysis_type"], }, },
  • Dispatch case in handleToolCall function that routes calls to the generate_stata_code handler.
    return handleGenerateStataCode(args); case "generate_python_code":

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seanshin0214/quantmaster-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server