Introduction to Stata: Course

Over the past few months, I’ve been writing a course giving an introduction to Stata. I haven’t made an online course before, so it’s a been a bit of a learning curve. As it turns out, my idea to record piano songs and upload them for people to listen to during the exercises didn’t work – there’s a definite copyright issue there – and while I’m happy to talk about Stata for hours on end, I wasn’t great at introducing myself, so it took my half an hour to record the first 3 minutes. Automatic captions also need a huge amount of work to make them look good: I’m going through them, but I think it’ll take about twice the length of the video to get the correct captions. For instance, Youtube thinks Stata is spelled “Stator” or “data”…

I designed the course to give a detailed introduction to Stata, hopefully without presuming any prior knowledge. I think the videos are pretty detailed, and I included quite a lot of explanation, as well as exercises and answers. Everything is freely available, though I have a donate/support link in case that’s something anyone wants to do. I don’t think Youtube will put ads on these videos, but if it does, please let me know and I’ll switch to hosting on this blog instead. Also, if anyone would like my to put up posts for each lesson with the coursebook information, let me know

All the course materials, including a coursebook, Stata data and do files, including all the code used during the lessons and all the answers for the exercises, are available on my Github page.

I haven’t finished all the lessons yet, but I have started uploading the lessons to Youtube. As I finish the lessons, I’ll update this page to show what’s new.

Lesson 1: Getting Started

This lesson covers: why to use Stata, Stata’s interface, do files (Stata’s script files), information about the dataset we’ll be using in these lessons, loading and saving data, changing the working directory, and using the data browser and editor to look through a dataset.

Lesson 2: Basic Commands

This lesson covers: displaying variables, displaying summary information about variables, generating, replacing, and renaming variables, labelling variables, applying labels to numeric data, and removing data.

Lesson 3: Restricting Commands

This lesson covers: restricting commands using in, if and by, as well as how to sort, order and preserve datasets.

Lesson 4: Manipulating Strings and Dates

This lesson covers: how to convert string variables to both numeric and labelled numeric variables (and vice versa), introduces some useful commands in manipulating strings (including a little about how to use egen), how to format variables, and how to manipulate dates.

I had to split this lesson into two parts: part two is here.

Lesson 5: Macros and Retrieving Information

This lesson covers: how to use both local and global macros, and how to retrieve and use information stored from commands in Stata.