AI Agents and Prompt Engineering in Econometric Coding / Sebastian Galiani, Federico Ariel López, Raul A. Sosa.

Author
Galiani, Sebastian [Browse]
Format
Book
Language
English
Published/​Created
Cambridge, Mass. National Bureau of Economic Research 2026.
Description
1 online resource: illustrations (black and white);

Details

Series
  • Working Paper Series (National Bureau of Economic Research) no. w35588. [More in this series]
  • NBER working paper series no. w35588
Summary note
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 74 to 96 percent, at about eight additional cents per run. For Claude Sonnet 4.6 and GPT-5.4 through Codex, few-shot prompting improves the chatbot far more than the constrained agent, indicating that prompting and agency act as substitutes. For these models, differences across statistical software are sizeable under the chatbot but largely disappear under the constrained agent.
Notes
August 2026.
Source of description
Print version record
Statement on responsible collection description
Princeton University Library aims to describe library materials in a manner that is respectful to the individuals and communities who create, use, and are represented in the collections we manage. Read more...
Other views
Staff view

Supplementary Information