PROGRAM
SESSION I: PROGRAMMING BASICS | A QUICK REVIEW
Macros
Global macros
Local macros
Scalars and matrices
Temporary objects
Looping
Branching
SESSION II: WRITING STATA PROGRAMS
Programming in Stata
Do-files and ADO-files
Writing and modifying a Stata programs
Programs without arguments
Programs with positional arguments
Programs with named positional arguments
Storing and retrieving program results
Programs with arguments using the “syntax” construct
Using tokenize and macro shift
ADO-files
Implementing program options
The return statements
Sample restriction with marksample and markout
Making a command “byable”
The use of sortpreserve
Writing an rclass ADO-file
Implementing program options
Sample restrictions with marksample
The usefulness of markout
Make a program “byable”
The use of sortpreserve
Writing an eclass ADO-file
More on storing results in e()
A eclass program template
Temporarily destroying the data in memory
Local sub-routines
SESSION III: STATA MATRIX CAPABILITIES
Stata matrix commands
Stata matrix input and output
Matrix input from Stata estimation results
Stata matrix subscripts and combining matrices
Matrix operators
Matrix functions
Defining a macro by a matrix function
Matrix accumulation commands
SESSION IV: PROGRAMMING ESTIMATORS
Programming Linear Least Squares estimation
Programming Maximum Likelihood estimation
Some examples
COURSE REFERENCES
An Introduction to Stata Programming, Christopher F. Baum, Second Edition, Stata Press 2016