Using large language models and coding agents to translate Stata packages: Benefits and risks
Stephen Thompson,
James Carpenter,
Tra My Pham,
Asif Tamuri,
David Fisher,
David Perez-Suarez,
Matteo Quartagno and
Carlos Diaz Montana
Additional contact information
Stephen Thompson: University College London
James Carpenter: University College London
Tra My Pham: University College London
Asif Tamuri: University College London
David Fisher: University College London
David Perez-Suarez: University College London
Matteo Quartagno: University College London
Carlos Diaz Montana: University College London
UK Stata Conference 2026 from Stata Users Group
Abstract:
Packages written in Stata are often focused on solving specific problems in specific research domains. Within the research domain, many people use Stata, so code sharing and reuse is possible. The code itself, however, may be high quality and useful to other research domains, but this may be prevented by limited use of Stata in other domains. Translating Stata code to other programming languages may therefore help researchers to reach beyond their own domain, increasing research impact. Translation requires skills in the source and target language, and the research domain, making it unlikely that any individual will be able to perform translation. Large language models (LLM) support translation by amalgamating language and domain-specific knowledge from many sources. We will discuss our experiences in developing a Claude Code plugin that supports domain experts in statistics in translating community-contributed Stata packages to R and Python. The plugin implements four skills: Analyze and plan: Is the package well documented? Which target language? Create a new library or contribute to an existing library. Translation to pseudocode: Translate to pseudocode to support human review without language expertise. Excludes any existing tests. Pseudocode to target language: Translate; add infrastructure to support ongoing open-source development (continuous integration testing, contributing guidelines, licenses). Tests and documentation: Implement any existing Stata tests in target language; summarize test correspondence; highlight missing tests. Review documentation (examples, papers), and translate to target language (for example, Vignettes in R). We used the plugin in workshops with statisticians to translate a selection of Stata packages. We will discuss our experiences in code translation, discussing the quality and applicability of the results.
Date: 2026-09-05
References: Add references at CitEc
Citations:
There are no downloads for this item, see the EconPapers FAQ for hints about obtaining it.
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:lsug26:07
Access Statistics for this paper
More papers in UK Stata Conference 2026 from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().