Update Your Skills

General Questions

Top 10 Questions from Beginners: From the UCLA ATS group

Workflow/Coding Principles

What is a macro, how do I use it Stata?: Macros help limit the amount of code you need to use as well as deal with temporary files.

What is a loop, how do I use it, why is it good to use loops for programming in Stata, what are different types of loops? Link 1, Link 2
How do I merge data in Stata? Link 1Link 2
Loops, Locals, Regressions: How can I combine loops and locals to estimate lots of separate regression models without having to write everything out?

Collection of programming tricks: loops, macros, globals, etc.. Nice Collection of examples.

Can I source a do file within another do file? Link 1Link 2

Dealing with local directories when sharing do-files: What if I'm sharing do files with other people who use different file paths, what are some easy ways to change the project folders?

Additional Coding Tricks


How do I create fake data sets in Stata?

How do I change directories in Stata? Windows,Mac

String variable manipulation: I want to manipulate string variables. What are some ways to do this?

Regression Post-Estimation: After I estimate a regression model, can I access stored estimates somehow? How about getting the variance-covariance matrix?

File paths: What if I'm sharing do files with other people who use different file paths, what are some easy ways to have things automatically?

Use the kountry package to standardize World Bank, Correlates of War, IMF country codes across datasets... don't do it by hand!

Simulation: How to simulate in R and Stata.