Course Overview
Delivered online using Zoom Webinars, this course is presented in a two part sequence and will teach Stata Programming at an introductory and advanced level.
The first part, is for Stata users, professionals and researchers from all academic disciplines, who would like to use Stata programming techniques to enhance the efficiency and reliability of their research. The course assumes familiarity with Stata’s command-line interface and the use of do-files and log files to produce reproducible results. The participants will learn how to use do-file programming techniques effectively, including topics such as local and global macros, r-returns and e-returns, implicit and explicit loops and debugging techniques.
The second part, is for users who have completed the companion course Introduction to Stata Programming and would like to use more advanced features of the Stata and Mata programming languages. The course assumes familiarity with Stata’s command-line interface and the use of do-files and log files to produce reproducible results. The participants will learn how to implement new Stata commands with ado-files and egen
functions. Mata programming techniques will illustrate how this language can be used to simplify and accelerate computations.
An Introduction to Stata Programming, Second Edition
Christopher Baum is the author of An Introduction to Stata Programming, Second Edition - Stata Press.
Course Agenda
The course comprises 2 x 2-hour sessions per day, including interactive practical exercises each afternoon.
Day 1 - Introduction to Stata Programming
3 September 2020
Session 1: Some fundamental concepts
- Do and ado files in Stata
- Data types: Working with dates and time, time series operators, factor variables
- Debugging – the capture command
- Protecting your data with preserve and restore
Session 2: Programming do-files
- Transformation of string and numeric variables
- Recoding discrete and continuous variables
- Recoding missing variables
generate
and egen
functions
- Local and global macros
- Extended macro functions and list functions
- Scalars and matrices
- Temporary variables and
tempnames
- Looping commands:
forvalues
and foreach
by
, statsby
, rolling
and other prefix commands
- Transforming data with
reshape
- Combining datasets with
append
and merge
Session 3: Practical session using Stata
Day 2 - Introduction to Stata Programming
4 September 2020
Session 1: Concepts and tools in action
- Tabulating and computing statistics across a set of variables and groups
- Computing durations and aggregating transactions data
- Summarizing group characteristics over observations
- Adding aggregate characteristics to micro observations
- Reusing results:
return
and ereturn
commands
- Accessing estimation results and margins
Session 2: Automation for tables and graphs
- Storing results in matrices
- Stata’s
post
and postfile
commands
- Automating estimation output – the user-written commands
estout
and tabout
, saveresults
- Automating graphical output
Session 3: Practical session using Stata
Day 3 - Advanced Stata Programming
8 September 2020
Session 1: Introduction to ado-file programming
- Structure of an ado-file
- Syntax and return statements
- Using program options
- Including a subset of observations
- Generalizing commands to handle multiple variables
- Rendering commands
byable
Session 2: e-class programs and egen functions
- Writing an e-class program
- Programs for
egen
, ml
, nl
- Programs for
gmm
- Guidelines for ado-file programming style
Session 3: Practical session in Stata
Day 4 - Advanced Stata Programming
9 September 2020
Session 1: Introduction to Mata
- Mata Fundamentals
- One-line use of Mata in a do-file
- A simple Mata function
- Components of a Mata function
- Calling Mata functions
- Mata’s
st_interface
functions
Session 2: Mata’s advanced features
- Mata-based likelihood function evaluators
- Creating arrays of temporary objects with pointers
- Structures
- Examples of Mata usage
Session 3: Practical session in Stata
Prerequisites
- Principal text for pre- and post-course reading:
- Christopher F Baum. 2016. An Introduction to Stata Programming, Second Edition. College Station, TX: Stata Press.
Terms and Conditions
- Student registrations: Attendees must provide proof of full time student status at the time of booking to qualify for student registration rate (valid student ID card or authorised letter of enrolment).
- Additional discounts are available for multiple registrations.
- Delegates are provided with temporary licences for the software(s) used in the course and will be instructed to download and install the software prior to the start of the course.
- Payment of course fees required prior to the course start date.
- Registration closes 1 day prior to the start of the course.
- 100% fee returned for cancellations made over 28-calendar days prior to start of the course.
- 50% fee returned for cancellations made 14-calendar days prior to the start of the course.
- No fee returned for cancellations made less than 14-calendar days prior to the start of the course.
The number of delegates is restricted. Please register early to guarantee your place.