Session1(approx. 3 hours)
Using Stata programming: somefundamental concepts
• Should youbea Stataprogrammer?
• Overview of the Stataenvironment
• Do-andado-filesinStata
• Producingreproducibleresearchresults
• Workingwith the commandline
• Datatypes
• Time seriesoperators
• Factorvariables
• Debugging andtracing
• Protecting yourdata
• Guidelinesforwritingdo-files
Session2(approx. 3 hours)
Programming Stata do-files
• Workingwith missingvalues
• Recodingdiscreteandcontinuousvariables
• Generate and egenfunctions
• Transformationofstringandnumericvariables
• Local macros andscalars
• Looping commands: forvalues andforeach
• Globalmacros
• Extended macro functions and listfunctions
• Statamatrices
• Prefix commands: by,statsby,rolling
• Combining data sets with append andmerge
• Transformingdatawithreshape
Session3(approx. 1.5 hours)
Programming concepts and toolsin action
• Toolsfor do-fileauthors
• Loopingoverobservations is rarelyappropriate
• Thebyprefixcanoftenreplacealoop
• Repeatedstatementsareusuallynotneeded
• Somesimplecommandsareoftenoverlooked
• Reusingresults:returnandereturncommands
• Tabulating and computing groupstatistics
• Summarizinggroupcharacteristicsoverobservations
• Addingaggregatecharacteristicstomicroobservations
• Computing durations andspells
• Aggregatingtransactionsdata
Session4(approx. 1.5 hours)
Automation with do-fileprogramming
• Statas post and postfilecommands
• Production of summarystatistics
• Production of estimatestables
• Productionofsetsoftablesandgraphs
Session5(approx. 3 hours)
Ado-file programming
• Structure of anado-file
• The syntaxstatement
• Includingasubsetofobservations
• Using programoptions
• Temporaryvariablesandtempnames
• The returnstatement
• A sampleprogram
• A second example of ado-fileprogramming
• A third example of ado-fileprogramming
• Maximumlikelihoodestimation
• Nonlinear least squaresestimation
• Writingan egenfunction
• Programs forgmm
• ado-files for Monte Carlosimulation
• Writingan e-classprogram
Session6(approx. 4 hours)
Introduction to Mata
• Matafundamentals
• Syntax of thelanguage
• DesignofaMatafunction
• Matasinterfacefunctions
• A simple Matafunction
• A multi-variablefunction
• Example of Mataprogramming
• Mata-basedlikelihoodfunctionevaluators
• Creating arrays of temporary objects withpointers
• Matastructures
• A Mata-based estimationroutine
Recommended reading:AnIntroduction to Modern Econometrics Using Stata, Stata Press, 2006; Chinesetranslation available from Renmin University Press.
AnIntroduction to Stata Programming, Second Edition,Stata Press, 2016.