IDEAS home Printed from https://ideas.repec.org/p/boc/lsug26/07.html

Using large language models and coding agents to translate Stata packages: Benefits and risks

Author

Listed:
  • 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)

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.

Suggested Citation

  • Stephen Thompson & James Carpenter & Tra My Pham & Asif Tamuri & David Fisher & David Perez-Suarez & Matteo Quartagno & Carlos Diaz Montana, 2026. "Using large language models and coding agents to translate Stata packages: Benefits and risks," UK Stata Conference 2026 07, Stata Users Group.
  • Handle: RePEc:boc:lsug26:07
    as

    Download full text from publisher

    To our knowledge, this item is not available for download. To find whether it is available, there are three options:
    1. Check below whether another version of this item is available online.
    2. Check on the provider's web page whether it is in fact available.
    3. Perform a
    for a similarly titled item that would be available.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:lsug26:07. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/stataea.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.