Lecture 33
Least Squares
DATA 8
Fall 2019
Source: xkcd.com/1725
Regression roadmap
Announcements
Linear Regression (Review)
Regression Estimate
Goal: Predict y using x
To find the regression estimate of y:
Discussion Question
A course has a midterm (average 70; standard deviation 10)�and a really hard final (average 50; standard deviation 12)
If the scatter diagram comparing midterm & final scores for students has an oval shape with correlation 0.75, then...
What do you expect the average final score would be for students who scored 90 on the midterm?
How about 60 on the midterm?
(Demo)
Regression Line
Standard Units
(0, 0)
1
r
Original Units
(Average x,� Average y)
SD x
r * SD y
Slope and Intercept
estimate of y = slope * x + intercept
(Demo)
Regression Line
Discussion Question
Suppose we use linear regression to predict candy prices (in dollars) from sugar content (in grams). What are the units of each of the following?
Least Squares
Error in Estimation
(Demo)
Least Squares Line
(Demo)
Numerical Optimization
(Demo)