COURSE ID: D-IN16-OL LANGUAGE:

AUTOMATING YOUR RESEARCH IN STATA: “A LITTLE BIT OF PROGRAMMING GOES AN AWFULLY LONG WAY!”

This course aims to provide participants with the fundamental Stata programming toolkit in order to facilitate, automate, replicate and personalize both data analysis, management and presentation. As such, session 1 reviews some general Stata commands, illustrating how they can be combined with some powerful Stata programming constructs for looping and branching. The course then moves on to focus on how the programming concepts of Macros, Loops, and Branching, can be implemented to effectively write, modify and develop do files (user written Stata programs).

In common with TStat’s course philosophy, each session is composed of both a theoretical component (in which the programming techniques are fully explained via a series of course specific developed examples), and an applied (hands-on) segment, during which participants have the opportunity to implement the techniques under the watchful eye of the course tutor.

At the end of the course, it is expected that participants are able to personalize existing Stata commands and develop their own do files in order to organize their workload in a more automated, efficient, flexible and reproducible manner.

Researchers or professionals with previous programming skills in other software wishing to work effectively in Stata. Existing Stata users wishing to acquire the “standard” Stata programming toolkit in order to implement basic programming techniques to effectively automate a substantial part of their empirical data analysis.

It is expected that individuals wishing to follow this course have a sound working knowledge of Stata. Participants are not however, required to have any programming experience in Stata or in other statistical packages.

SESSION I: ORGANISING, MANIPULATING AND VISUALIZING YOUR DATASETS WITHIN A DO-FILE – A REVIEW

  1. Saving the dataset
    • save, preserve, restore
  2. Advanced data management commands
    • keep and drop
    • sort and gsort
    • by-processing
    • append
    • merge and joinby
    • collapse and contract
    • order, aorder, move, reshape (for panel data)

SESSION II: STATA CONSTRUCTS FOR DO-FILES PROGRAMMING

  1. Stata syntax
  2. Global and local macros
    • Global macros
    • Local macros
    • Recalling macros
  3. Scalars and matrices
  4. Extended macro functions
  5. Macro increment and decrement functions
  6. Advanced local macro manipulation
  7. Temporary objects
    • Temporary variables: tempvar
    • Temporary Matrices and vectors: tempname
    • Temporary Files: tempfile
  8. Looping in Stata
    • Looping using foreach
    • Looping using forvalues
    • Looping using while
  9. Branching in Stata with: if and else
  10. Writing and modifying a Stata program
    • Programs without arguments
    • Programs with positional arguments
    • Programs with named positional arguments
    • Storing and retrieving program results
  11. Programs with arguments using the syntax construct

SESSION III: AUTOMATION DO-FILE PROGRAMMING IN PRACTICE – MAKING LIFE EASIER!

  1. A DO-file template
  2. Master and Using DO-files
  3. Speeding-up your workflow within a DO-file: real examples
    • Running estimations under alternative model specifications
    • Building, modifying and automating tables of estimation output
    • Returning estimation (return, ereturn)
    • Building, modifying and automating graphs
    • Stata graphic capabilities
    • The syntax of the graph command
    • Customizing graphs

SESSION IV: AUTOMATING THE TRANSFER OF STATA RESULTS TO EXTERNAL SOFTWARES – STATA’S MATRIX CAPABILITIES

  1. Stata basic matrix commands
  2. Stata matrix input and output
  3. Matrix input from Stata estimation results
  4. Stata matrix subscripts and combining matrices
  5. Data/Matrix conversion
  6. Integrating Stata matrix capabilities for DO-file automation: examples

COURSE REFERENCES

Baum, C.F., (2016). An Introduction to Stata Programming Second Edition, Stata Press Publication.

The 2025 edition of this training course will be offered online on a part-time basis on the 26th, 27th, 28th of March. To this end, programme includes a series of sessions based on 3 modules from 10.00 am to 2.30 pm Central European Time (CET).

Full-time Student*: € 710.00
Full-time PhD Student: € 910.00
Academic: € 1045.00
Commercial: € 1400.00

*To be eligible for full-time student prices, participants must provide proof of their full-time student status for the current academic year. Our standard policy is to provide all full-time students, be they Undergraduates or Masters, access to our student registration rates. Part-time master and doctoral students on the other hand, who are also currently employed will however, be assigned the standard academic registration fee.

Fees are subject to VAT (applied at the current Italian rate of 22%). Under current EU fiscal regulations, VAT will not however applied to companies, Institutions or Universities providing a valid tax registration number.

The number of participants is limited to 8. Places will be allocated on a first come, first serve basis. The course will be officially confirmed, when at least 5 individuals are enrolled.

Course fees cover: teaching materials (handouts, Stata do files, program templates and datasets to use during the course), a temporary course licence of StataNow™ valid for 30 days from the beginning of the course.

Individuals interested in attending the training course, must return their completed registration forms to TStat by the 16th of March 2025.


NAME

EMAIL

OBJECT

ADDITIONAL COMMENTS

I authorise the use of my personal data in accordance with the European Union’s General Data Protection Regulation 2018

ONLINE FORMAT

This course aims to provide participants with the fundamental Stata programming toolkit in order to facilitate, automate, replicate and personalize both data analysis, management and presentation.

 

The 2025 edition of this training course will be offered online on a part-time basis on the 26th, 27th, 28th of March.