Key Concepts

Review core concepts you need to learn to master this subject

Multiple Linear Regression

Multiple linear regression is an extension of simple linear regression used to model the relationship between a quantitative response variable and two or more predictors, which may be quantitative, categorical, or a mix of both. This allows us to control for confounding variables, which may distort the perceived relationship between two variables if not accounted for.

Multiple Linear Regression
Lesson 1 of 2
  1. 1
    Simple linear regression may be used to understand and make predictions about the relationship between two variables. But what happens when there are more than two variables? When we want to u…
  2. 2
    We often write the equation of a line in the form y=mx+b, where m is the slope of the line and b is the y-intercept. Since we will be adding at least two predictors to a multiple regression…
  3. 3
    To run a multiple linear regression in Python, we can use the function OLS.from_formula() from statsmodels.api. For example, if we want to run a regression to predict score using hours_studied and …
  4. 4
    Binary categorical variables are variables with exactly two possible values. In a regression model, these two values are generally coded as 1 or 0. For example, a multiple regression equation from …
  5. 5
    While we can view a binary categorical variable as a way of creating two new regression equations with different intercepts, we don’t need to make these equations every time we want to interpret a …
  6. 6
    In the previous exercises, we looked at regression models with one quantitative predictor and one binary predictor, but we can also have models with multiple quantitative predictors. For example, c…
  7. 7
    In a multiple regression model, the coefficient on a quantitative predictor is the expected difference in the outcome variable for a one-unit increase of the predictor, holding all other predictors…
  8. 8
    Sometimes we use regression to understand the relationship between two variables because we wish to control for potential confounders. For example, based on the survey dataset, we may be primarily …
  9. 9
    In the last exercise, we explored how a coefficient may change when additional predictors are added to a model. When adding predictors entirely reverses the sign of the coefficient, this is called …
  10. 10
    When doing any type of statistical analysis, we should always keep the assumptions in mind. Multiple linear regression requires some of the same assumptions as simple linear regression: 1. Linea…
  11. 11
    Congratulations! In this lesson you’ve learned to: * Fit a multiple linear regression model in Python * Write and interpret a multiple regression model * Understand what binary and quantitati…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo