Self-Study Course for Stata
Before you start
Getting started
Variables
Data transformation
Basic regression
Tables and graphs
Objects, loops, and branching
Macros
Scalars and matrices
Loops
Exercise
Compound quotes in loops
Replication & transparency
Introduction to Programming
Advanced Programming
Applied Programming
Mata
Further topics
Understanding your code
The trace command can help you understand what happens inside your loop.
Understanding your code: presentation
(PDF)
A comment on the trace command