EconPapers    
Economics at your fingertips  
 

AI Agents and Prompt Engineering in Econometric Coding

Federico Ariel López, Raúl Sosa and Sebastian Galiani

No 4907, Asociación Argentina de Economía Política: Working Papers from Asociación Argentina de Economía Política

Abstract: We study how large language models write code for econometric analysis. We compare three dimensions of AI-assisted coding: statistical software (Stata, R, or Python), prompting (zero-shot versus few-shot), and the degree of agency, from a chatbot that writes a single script to an agent that executes and revises its own code. On a benchmark of applied econometric and statistical tasks, moving from the chatbot to the constrained agent raises task success from 82 to 97 percent, at about eight additional cents per run. For Claude Sonnet 4.6 through Claude Code and GPT-5.4 through Codex, few-shot prompting improves the chatbot far more than the constrained agent. For these models, differences across statistical software are sizeable under the chatbot but largely disappear under the constrained agent.

JEL-codes: C18 C87 (search for similar items in EconPapers)
Pages: 34 pages
Date: 2026-12
References: Add references at CitEc
Citations:

Downloads: (external link)
https://aaep.org.ar/works/works2026/4907.pdf (application/pdf)

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:aep:anales:4907

Access Statistics for this paper

More papers in Asociación Argentina de Economía Política: Working Papers from Asociación Argentina de Economía Política Contact information at EDIRC.
Bibliographic data for series maintained by Juan Manuel Quintero ().

 
Page updated 2026-12-04
Handle: RePEc:aep:anales:4907