← 返回报告列表

MCP-for-Stata: A research report on AI-assisted empirical research

2025-09-21Tan, Song and Feng, Muyao

摘要

Data analysis is central to social science research, yet technical barriers still limit efficiency. While Stata lowers the learning cost of coding, further simplification is possible. This study develops MCP-for-Stata to streamline coding via AI and promote automation in empirical work. Using the ReAct agent framework and a custom evaluation set, we systematically assess LLMs across key stages of empirical research. Results show: (1) LLMs perform well in Stata code generation and debugging; (2) models differ notably in econometric understanding and coding, with the Claude series leading; (3) whether LLMs can conduct empirical analysis independently remains open. We also identify two key technical bottlenecks: (1) improving context management and overcoming window limitations through engineering; (2) fine-tuning the ReAct framework to better align with the needs of social science research.

下载完整报告

下载报告

引言

As the coding capabilities of large language models (LLMs) continue to advance, we aim to explore whether these models can directly generate Stata code to support the data analysis process in social science research, including both code writing and debugging. Building on this foundation, we further investigate whether AI can genuinely assist in accomplishing tasks within academic research.

方法

Inspired by the concept of Generative Adversarial Networks (GANs), we developed a text-based scoring system, the MASA System (Model Adversarial Scoring Architecture). This framework enables a faster, more convenient, and more objective evaluation of agent performance, which constitutes one of the distinctive features of this study.

结果

By examining model performance across different tasks, we obtained their comparative results. Unsurprisingly, Claude achieved the best overall performance—though it is also the most expensive. What was unexpected, however, is that DeepSeek outperformed OpenAI’s GPT-5, while its cost is nearly one-tenth of OpenAI’s and about one-hundredth of Claude’s. Additional details can be found on Twitter (https://x.com/sepinetam/status/1974391352873132147)

结论

Missing