Interpreting Slope and Intercept

Introduction to Linear Modeling in Python

Jason Vestuto

Data Scientist

Reminder: Terminology

Review:

  • y = a0 + a1*x
  • x = independent variable, e.g. time
  • y = dependent variable, e.g. distance traveled
  • xp = 10; yp = a0 + a1*xp, "model prediction"
Introduction to Linear Modeling in Python

Intercept

Plot of line intercepting vertical y-axis at y=100 for x=0

x0 = 0
print(y(x0))
100
Introduction to Linear Modeling in Python

Slope

Plot of line intercepting vertical y-axis at y=100 for x=0, but with point midway between start and end of line, marked with dashed line segments indicating horizontal run and vertical rise

slope = (225 - 100) / (5 - 0)
print(slope)
25
Introduction to Linear Modeling in Python

Average Slope

Plot of line intercepting vertical y-axis at y=100 for x=0, but with point at end of line, marked with dashed line segments indicating horizontal run and vertical rise

slope = (350 - 100) / (10 - 0)
print(slope)
25
Introduction to Linear Modeling in Python

Rescaling versus Dependency

Plot of line of temperatures, with first point at y=32 degrees F and x=0 degrees C, and with second point at y = 212 degrees F and x = 100 degrees C, connected by dashed line segments indicating horizontal run and vertical rise

slope = (212-32)/(100-0) # 180/100 = 9/5
intercept = 32
Introduction to Linear Modeling in Python

Let's practice!

Introduction to Linear Modeling in Python

Preparing Video For Download...