Multivariate Regression in Stata

The text below is a transcript of the video above, edited with AI assistance for clarity and flow. Where the two differ, the video is the authoritative version.

You’ll learn to

In this video you will learn to run and analyse multivariate regressions using Stata. You will learn to:

  • Run a multivariate regression in Stata.
  • Read the output with multiple explanatory variables.
  • Compare bivariate and multivariate results side by side on the Stata screen.

Materials

The companion do-file for this video is multivariate-brexit.do. It is available in the Shared Project Folder, in the do folder. Save it into the do folder on your own computer.

The do-file: three regressions

The do-file runs three regressions on the Brexit Regional dataset. Two of them are bivariate and one is multivariate: a bivariate regression of education and the Leave vote, a bivariate regression of immigration and the Leave vote, and a multivariate regression with both education and immigration as explanatory variables for the outcome, the share of Leave votes.

Recall: Bivariate regression syntax

Recall the bivariate regression that you are already familiar with. The Leave vote share is on the left-hand side, as the dependent variable, the outcome. The share of people with higher education is on the right-hand side, as the independent variable, the explanatory variable.

regress leave_share share_high_skill

One dependent variable, one explanatory variable. You type regress, then the dependent variable, then the independent variable. That is the bivariate regression syntax in Stata.

Adding a second variable

When we add a second variable, it is the same regress command. You just add variable names.

regress leave_share share_high_skill immigrant_share

There are no commas or anything else. You type regress, the dependent variable, and then you list whatever explanatory variables, whatever right-hand side variables, you want to add. You keep adding them one by one, each variable separated by a space.

Reading the output: coefficient table

The output has one row for each explanatory variable, plus a row for the intercept.

Element What it tells you
share_high_skill row Slope, p-value, and CI for education
immigrant_share row Slope, p-value, and CI for immigration
_cons row Intercept (same as bivariate output)

Let’s see this in Stata. With the multivariate-brexit.do do-file open and the Brexit data loaded, start by recalling the first two models. The first is the regression with the Leave share as the dependent variable and the share of people with higher education as the independent variable. In the output you have the coefficient, which is the slope, then the standard error, which you now know about, the t-statistic, the p-value, and the confidence interval.

You can then do the same for the Leave share and the immigrant share:

regress leave_share immigrant_share

Again you have the coefficient, standard error, t-statistic, p-value and confidence interval for this bivariate regression. Remember that when you run a bivariate regression with the immigrant share as the independent variable, you do get a negative and statistically significant coefficient.

Now run the multivariate regression with both education and immigration together. For the education variable, we still observe a coefficient that is very close to the one we observed before. The standard error is small relative to the coefficient, and the t-statistic is −7.71, so its absolute value is much greater than 2. This is reflected in a very small p-value and a 95% confidence interval that does not include zero.

By contrast, when you look at the immigrant share, the coefficient is near zero. The standard error is even larger than the coefficient, so there is a lot of uncertainty. This is reflected in a t-statistic whose absolute value is smaller than 2. The p-value is above 0.05, and the 95% confidence interval does include zero.

You have that information for these two variables, and you can then compare what you get for the immigrant share in the bivariate regression with what you get for the immigrant share in the multivariate regression. The coefficient “goes away” from the bivariate regression to the multivariate regression.

Interpreting the coefficients

Each coefficient is interpreted holding the other variable constant, “all else equal”.

  • The education slope, −1.14, is the expected change in the Leave share per point of education, holding immigration constant.
  • The immigration slope, 0.08, is the expected change in the Leave share per point of immigration, holding education constant. With a p-value of 0.449, the immigration slope in the multivariate regression is not statistically significant.

Comparing bivariate and multivariate results

Bivariate Multivariate
Immigration -0.41 0.08
Education (not included) -1.14

Immigration was significant alone, but not after controlling for education.

R-squared comparison

When you look at the R-squared, it is very close between the two models: 0.30 in the bivariate regression with education only, and 0.30 in the multivariate regression with both variables. This tells you that adding immigration barely improved the explanatory power of the regression. That is consistent with the fact that the immigration slope is not statistically significant when we run the multivariate regression.

Recap

  • Add variables to regress to run a multivariate regression.
  • Each coefficient is interpreted holding the other variables constant.
  • Comparing models helps us understand whether variables contribute independently to the outcome we are studying.

Why this matters

Multivariate regression is the workhorse of quantitative social science. You are going to see it all the time in quantitative papers. And Stata makes it very simple to add and compare variables whenever you are working with multivariate regressions.