AI-Assisted Coding in Stata and R

AI
coding
workflow
stata
R
Positron
GitHub Copilot
Learn how to harness the power of AI in your daily analytical work using Stata and R. Essential tools that can significantly improve your analysis and coding workflow are demonstrated.
Author

Eduard Bukin

Published

February 5, 2026

Overview

Many tasks in Stata or R/Python can be done more efficiently with support from AI tools (such as Anthropic Claude, ChatGPT, or GitHub Copilot). However, using AI only through a web browser (or Windows Copilot) captures only a small share of its potential.

This first seminar focuses on how microeconomists can use Positron which is an integrated development environment (IDE) designed for data analysis and statistical programming. It is developed by Posit (the company behind RStudio) and is built on Visual Studio Code, but tailored specifically for R, Python, and data-science workflows. In practical terms, Positron combines the flexibility of VS Code with features that are familiar to users of RStudio. This is a very powerful approach that uses World Bank–approved development environment that can run Stata or R code directly and integrate AI agents. It also makes AI more “aware” of your working context (your scripts, folders, and outputs), so it can help you write, debug, document, and validate code in a way that is specific to your data and objectives.

Speaker

Eduard Bukin (ebukin@worldbank.org)

Opening Remarks: Gabriela Inchauste

Series Lead: Maria Eugenia Genoni (mgenoni@worldbank.org)

Moderator: Henry Stemmler (hstemmler@worldbank.org)

What You Will Learn

During this first session, we will:

  • Demonstrate how to use AI assistance in daily coding
  • Briefly introduce key AI-relevant concepts:
    • AI-Chat versus AI-Agent
    • Context awareness and model communication protocol (MCP)
    • Integrated Development Environments (IDEs): VS Code
  • Explain the software setup needed to leverage AI agents in analysis:
  • Show step-by-step practical cases of AI application to produce high-quality analysis based on a general task of “reproducibility package preparation”:
    • How and where to start
    • Effective prompt generation
    • Performing analysis
    • Quality control, validation and preventing hallucinations
  • Discuss further potential uses of AI-Agents in our everyday work

Materials

Seminar

Presentation Slides

View Slides | Download PDF

Additional Resources

Workflow Setup Instructions

View full setup instructions

To follow along with the seminar, complete these setup steps:

  1. Install prerequisite software from the World Bank Software Center: Stata 19+, R, Python, Git, Quarto
  2. Install the uv Python package for environment management
  3. Install Positron IDE (requires Software Installation Request)
  4. Install extensions in Positron: Stata MCP, Quarto
  5. Connect GitHub to Positron, if you do not have a GitHub account
  6. Enable Positron Assistant in Positron settings