Training Calendar

Stata Programming for Full Automation

  • Location: Sofitel, Downtown Dubai
  • Duration: 2 days (15th October 2017 - 16th October 2017)
  • Software: Stata
  • Level: Intermediate, Introductory
  • Delivered By: Dr. Giovanni Cerulli
  • Topic: Programming, Statistics
Stata Programming for Full Automation

Course Overview

This course will provide you with advanced tools for data management and full automation of your workflow using Stata. Relying on advanced Stata skills for data management and automation is essential to accomplish a series of important tasks, such as:

  • Speeding-up your Stata workflow;
  • Programming simple but effective Stata routines to be used recursively in .do files;
  • Modifying your Stata procedures without redoing the entire work from the beginning;
  • Increasing the readability of your code

Full automation of your workflow entails that, in just one click, you can compile your whole Stata workflow from the outset (when you set up the working directories) to the end (when you wish to obtain descriptive and estimation result tables ready for final publication).

The course starts by reviewing the main data management commands available in Stata (session 1), and goes on to illustrate how to combine them with constructing simple Stata programs (looping, branching, etc.). You will be taught how to easily code and use these programs efficiently (session 2). Session 3 deals with Stata matrix capabilities for data management, which are handy to accomplish specific tasks, by taking stock of what learnt in sessions 2 and 3. Session 4, finally, focuses on real data applications, develops guidelines, and suggests tricks to implement easily your Stata workflow's full automation.

Course Agenda


Session 1: Stata Data Management & Commands

  • Setting-up your workflow in Stata
  • Managing directories and folders (pwd, mkdir, cd, dir, copy, erase, type)
  • Reading data into Stata (import, export, use
  • Variable and data types (Numeric, String & Missing data)
  • Data examination (browse, edit, assert, describe, codebook, summarize, tabulate, inspect, graph)
  • Sub-setting the data using the if and in qualifiers
  • Creating and manipulating variables (generate, egen, replace, rename, recode & replace)
  • Converting strings to numerics and vice versa (tostring, destring, encode)
  • Codifying missing values (mvdecode / mvencode)
  • Generate dummy variables, lags and leads
  • Saving the dataset (save, preserve, restore)
  • Keeping track of your workflow (.do-files, .log-files and labelling)
  • Organising and manipulating your datasets (keep / drop, sort / gsort, byprocessing, append, merge / joinby, collapse / contract, order, aorder, move, reshape (for panel data)

Session 2: Stata constructs for data management full automation

  • The Stata syntax
  • Global and local macros
    • Recalling macros
    • Scalars and matrices
    • Extended macro functions
    • Macro increment and decrement functions
    • Advanced local macro manipulation
  • Temporary objects
    • Temporary variables: tempvar
    • Temporary Matrices and vectors: tempname
    • Temporary Files: tempfile
  • Looping in Stata using foreach, forvalues & while
  • Branching in Stata with: if & in
  • Writing and modifying a Stata program
    • Programs without arguments
    • Programs with positional arguments
    • Programs with named positional arguments
  • Storing and retrieving program results
  • Programs with arguments using the syntax construct


Session 3: Stata matrix capabilities for data management

  • The Stata matrix commands
  • Stata matrix input and output
  • Matrix input from Stata estimation results
  • Stata matrix subscripts and combining matrices
  • Matrix operators and matrix functions
  • Data/Matrix conversion using mkmat & svmat
  • Setting row and column names

Session 4: Stata workflow's full automation: guidelines and applications

  • A simple .do-file template for your workflow's full automation
  • Setting, guidelines and tricks for full automation
  • Automating descriptive and estimation results for final publication
  • Building publication quality tables for export with tabout
  • Making regression tables from stored estimates with estout
  • Examples on real datasets

Daily Timetable

09:00-09:20 Registration

09:30-11:00 Session 1

11:00-11:15 Break

11:15-12:45 Session 2

12:45-14:00 Lunch

14:00-15:15 Session 3

15:15-15:30 Break
(Feedback Session)

15:30-17:00 Session 4


  • A working knowledge of Stata software is required.
  • A basic level of programming skills is assumed.

Terms & 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.
  • Cost includes course materials, lunch and refreshments.
  • Attendees 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. Alternatively, we can also provide laptops for an additional cost of AED120 per day.
  • If you need assistance in locating hotel accommodation in the region, please notify us at the time of booking.
  • Payment of course fees required prior to the course start date.
  • Registration closes 5-calendar days 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 seats available is restricted. Please register early to guarantee your place.

  •  CommercialAcademicStudent
    2 days (15/10/2017 - 16/10/2017)

All prices exclude VAT or local taxes where applicable.

* Required Fields

- +
Post your comment

Timberlake Consultants