IDEAS home Printed from https://ideas.repec.org/p/cte/werepe/45949.html
   My bibliography  Save this paper

Assessing ChatGPT's ability to detect and correct programming errors in stata do-files

Author

Listed:
  • Mora, Ricardo

Abstract

This paper evaluates the efectiveness of ChatGPT in debugging Stata, a proprietary econometric software, with a focus on accuracy, hallucination tendencies, and the presence of illusory expertise. By systematically testing ChatGPT-3.5-turbo and ChatGPT-4o across diferent error types and user expertise levels, the study finds that while ChatGPT signifcantly improves debugging performance in open-book mode, its accuracy remainshighly dependent on error complexity. Hallucinations, where the model generates plausible but incorrect error explanations, are particularly frequent in syntax errors and persist even with access to error logs. Advanced scripts present the greatest challenge, with ChatGPT- 4o achieving only a 35.7 percent success rate and exhibiting a 25 percent hallucination rate despite access to error messages. The findings align with broader research on largelanguage models in coding assistance, demonstrating that ChatGPT struggles with complex debugging tasks in proprietary software environments like Stata, where integration is restricted.

Suggested Citation

  • Mora, Ricardo, 2025. "Assessing ChatGPT's ability to detect and correct programming errors in stata do-files," UC3M Working papers. Economics 45949, Universidad Carlos III de Madrid. Departamento de Economía.
  • Handle: RePEc:cte:werepe:45949
    as

    Download full text from publisher

    File URL: https://e-archivo.uc3m.es/rest/api/core/bitstreams/5cba974a-cebc-488f-9eb1-91c3f0839c68/content
    Download Restriction: no
    ---><---

    More about this item

    Keywords

    LLMs;

    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:cte:werepe:45949. 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: Ana Poveda (email available below). General contact details of provider: http://www.eco.uc3m.es/ .

    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.