Chapter 11 Multiple Regression
The linear least squares fit in the previous chapter is an example of regression, which is the more general problem of modeling the relationship between one set of variables, called response variables or dependent variables, and another set of variables, called explanatory variables or independent variables.
In the examples in the previous chapter, there is only one response variable and one explanatory variable, which is called simple regression. In this chapter, we move on to multiple regression, with more than one explanatory variable, but still only one response variable. If there is more than one response variable, thatโs multivariate regression, which we wonโt cover in this book.
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename):
from urllib.request import urlretrieve
local, _ = urlretrieve(url, filename)
print("Downloaded " + local)
download("https://github.com/AllenDowney/ThinkStats/raw/v3/nb/thinkstats.py")
try:
import empiricaldist
except ImportError:
%pip install empiricaldist
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from thinkstats import decorate
