From the course: Introduction to Stata

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Indicator variables

Indicator variables - Stata Tutorial

From the course: Introduction to Stata

Indicator variables

- [Instructor] In this session we're going to explore some of the ways that you can quickly generate indicator variables in Stata. These can also be referred to as dummy variables, binary variables, or qualitative variables. These variables are used for many purposes, and because they're used so often, Stata offers several ways to create them, and here, we'll take a look at some of these. Specifically, we'll use three commands that we've already introduced. We'll create a binary variable using the generate and replace commands. We refer to this as the old fashioned way because here we're going to spell everything out on separate lines of code. Then we'll take a look at the recode command and how we can use its generate option. And finally, we'll explore how we can use tabulate to quickly generate many dummy variables with its generate option. So let's set off to Stata. Here we are in Stata with the auto data…

Contents