From the course: Introduction to Stata
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Categorical explanatory variables in OLS - Stata Tutorial
From the course: Introduction to Stata
Categorical explanatory variables in OLS
- In the previous session, we built an ordinarily squares model with only continuous explanatory variables. However, sometimes we'll have non-continuous variables. And in this session, we're going to extend our model by introducing categorical variables to our regression. Stata is particularly good at this as almost all Stata commands, including regress, support a shortcut which allows us to include categorical variables in our code without having to do a lot of data manipulation. In particular, we're going to explore Stata's automated expansion capabilities by using the i dot and the ib brackets dot prefix options. By specifying these options in front of categorical variables, we can tell Stata to treat these variables specifically as categorical variables. So let's go take a look. Here we are in Stata and I've already loaded up the order data and ran our previous regression. Let's say that we now wanted to include…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
OLS regression and interpretation5m 36s
-
(Locked)
Categorical explanatory variables in OLS4m 53s
-
(Locked)
OLS regression diagnostics8m 31s
-
(Locked)
Exploring functional form in OLS regression5m 29s
-
(Locked)
OLS hypothesis testing4m 54s
-
(Locked)
Presenting OLS regression estimates5m 23s
-
(Locked)
Ordinary least squares regression: Challenge51s
-
(Locked)
Ordinary least squares regression: Solution3m 18s
-
(Locked)
-
-
-
-