AI coding assistants are constantly changing how applied research is conducted. Many young researchers now wonder whether learning to code is still worth the effort. IT IS, and it MATTERS MORE than ever.
AI can write a Stata do-file in seconds, but it can also make mistakes that are subtle, confident and easy to miss. Sometimes the cause of the error is a vague prompt. Sometimes it is a gap in the AI’s understanding of the data, the methodology or the subject. Only a prepared user who understands both the software and the statistics behind it can tell good code from code that simply looks correct. Used well, AI can greatly speed up your work and take your research to the next step, but such gains will only be achieved when you yourself know what you are doing.
This course offers you this foundation: the core Stata programming toolkit for automating, replicating and customising data management, analysis and presentation. It reviews key Stata commands and illustrates how they combine with Stata’s programming constructs. The course then focuses on macros, loops and branching, and on how to use them to write, read, debug and develop your own do-files and programs, whoever (or whatever) wrote the first draft.
COURSE OUTCOMES
By the end of the course, you will be able to:
- Write clean, efficient and reproducible do-files from scratch;
- Automate repetitive data management and analysis tasks;
- Read, check and adapt code, whether a colleague or an AI assistant wrote it;
- Use AI tools with confidence, knowing when to trust the output and when to question it.
Researchers or professionals with previous programming skills in other software wishing to work effectively in Stata. Existing Stata users wishing to acquire the “standard” Stata programming toolkit in order to implement basic programming techniques to effectively automate a substantial part of their empirical data analysis.
It is expected that individuals wishing to follow this course have a sound working knowledge of Stata. Participants are not however, required to have any programming experience in Stata or in other statistical packages.
SESSION I: WORKING WITH MULTIPLE DATASETS AND DATA MANAGEMENT IN A DO-FILE
- Working with multiple datasets in memory: preserve, restore, frames (frame create, frame change, frame put, frlink, frget, frame post)
- Advanced data management: append, merge, collapse, contract, reshape
SESSION II: STATA CONSTRUCTS FOR WORKFLOW PROGRAMMING
- Stata syntax
- Global and local macros, including Recalling macros
- Scalars and matrices
- Extended macro functions
- Macro increment and decrement functions
- Advanced local macro manipulation
- Temporary objects: tempvar, tempname, tempfile
- Loops: foreach, forvalues, while
- Branching with if and else
- Explicit subscripts in Stata
- Writing and modifying Stata programs: without arguments, with positional arguments, with named positional arguments, storing and retrieving results
- Programs with arguments using the syntax construct
SESSION III: AUTOMATION, DO-FILE PROGRAMMING IN PRACTICE
- A do-file template
- Master and using do-files
- Speeding up workflows with real examples: alternative specifications, automated estimation tables, returning results (return, ereturn), building and automating graphs
- Reproducibility essentials: version, set seed, relative paths, logging, a clean project folder structure
- Defensive programming and debugging: assert, confirm, capture with _rc, set trace on, display for checking macro contents
SESSION IV: ELEVATING YOUR STATA PROGRAMMING CAPABILITIES WITH AI TOOLS
- DEMO – Natural language productions and verification of your Stata workflow
- Illustrate typical failure modes: invented options or commands, wrong merge type, outdated syntax, macro quoting errors
- Good practice: precise prompts, testing on small subsets, never running code you cannot read
SESSION V: INTEGRATING STATA AND PYTHON
- A live example – time permitting
This course is being offered on the second day of the first Greek Stata Users Conference that will be held on the 28th and 29th of January 2027 at the Athens University of Economics and Business (AUEB).
Giovanni Cerulli, Ph.D. National Research Council of Italy – IRCrES
| Conference Only | Conference / Training Course | |
| Early Bird Registration for Students* (before 13 November 2026) | € 34.00 | € 106.00 |
| Students* (after 13 November 2026) | € 40.00 | € 125.00 |
| Others | € 95.00 | € 350.00 |
*To be eligible for student prices, participants must provide proof of their full-time student status for the current academic year. All participation fees are subject to VAT (applied at the current Italian rate of 22%); Individuals interested in participating should return their duly completed registration forms to the conference organizers by the 15 January 2027 at the very latest.
FUNDING FOR DOCTORAL STUDENTS
TStat is delighted to sponsor, via our project “Investing in Young Researchers”, TWO full-time Ph.D. students from any of the countries for which TStat is the official Stata Distributor. Sponsorship covers both the first day of the conference and the training course. Travel expenses are however, to be paid by the participant.
AI coding assistants are constantly changing how applied research is conducted. Many young researchers now wonder whether learning to code is still worth the effort. IT IS, and it MATTERS MORE than ever.