Introduction to Stata® Programming

Last update: February 17, 2009

Organizer: Metrika Consulting

Place: Stockholm, Sweden

Date: Saturday May 30, 2009

Language: English

Deadline: Sign up before May 23, 2009

Cancellation policy: If you have signed up and need to cancel, you do not need to pay any fee if you cancel more than 11 days before the course starts (the dead-line for signing up). You will need to pay half the fee if you cancel less than 11 days before the course starts.

Price: 3000 SEK, excl. VAT.

Registration: Just write an email to Metrika Consulting


Nicola Orsini
The National Institute of Environmental Medicine,
Karolinska Institutet, Stockholm, Sweden.
Tel: +46 8 52487837

Course description

This course is designed to introduce participants to the basics of programming in Stata. It focuses on the use of do-files and ado-files to automate your own work. Specific topics include macro variables, looping, branching, subscripting, and personalise the output. By the end of this one-day course, the participants will be able to program effectively in Stata®.


It is assumed that participants will have basic knowledge of Stata or be familiar with the contents of this course and have used Stata for at least few months.

Preliminary outline of the course

Morning session

  • How to keep a record of your work (do-file)
  • Access to saved results
  • Local macro
  • Looping (forvalues, foreach)
  • Branching (ifcmd)

Afternoon session

  • Ado-file
  • How to create a new Stata command (program)
  • Passing arguments to the program
  • Hide an control the output of Stata commands

  9:00 - 12:00 Morning Session
12:00 - 13:00 Lunch
13:00 - 16:00 Afternoon Session

The students will have their hands on a keyboard with Stata running troughout the learning sessions. Each learning session will give equal weight to tutorials and practical exercises.

Course material

Lecture notes, datasets, exercises, and solutions will be available over the web for the students.

{Home | Author | Presentations | Publications | Software | Courses | Links}