Sie sind auf Seite 1von 15

3.

2
Least-Squares Regression
Andrew Brown
AP Stats per. 6
Warm-Up Review (5 min)
1. What is Correlation?
2. What variables do you use in a scatter plot?
3. Describe this Scatter plot?
a. Correlation is the measurement of how strong of a
relationship between 2 Quantitative variables. It ranges from
-1 ≤ r ≤ 1 where r= correlation.
b. You use Quantitative variables in order to decide how strong
the two relate to one another.
c. Process Input and Quality Characteristic have a relatively
negative strong linear relationship that would be close to -1.
Vocab Throughout (3 min)
Regression Line

Extrapolation

Regression Equation Take a Minute to Write down


Residual what you think the definition
for each is. We will go over
Least Squares Regression Line
each of them throughout
Residual Plot

Sx of Residuals
Regression Lines
● We use regression lines to predict Y-values from
the x-values.
○ These LINES ARE ONLY MODELS
● This is allowed by the ŷ = a+bx
● Ex.
○ This graph you are able to predict the University GPA based
on your High school GPA

NOTE: Nothing can be used for sure. Only use the


regression line if it is in a good x-value interval and not
too far off the scale. It is known as extrapolation
Regression Equation
● ŷ = a+bx

What do the variables represent?

● ŷ - (Predicted y variable) PRONOUNCED “y-hat”


● A- y-intercept (Whenever x=0)
● B- slope of line (predicted amount of change)
● X- Your x-value
Example (3 min)
Find the predicted y-value/ “y-hat” with the given equation.

ŷ = a+bx

Slope = 0.08

Y-intercept = 83 points ŷ = 91 points

X-value = 100
CFU: Do on your own (5 min)
The equation ŷ = 80 + 35x explains the scatter plot of a weight (Grams) of a
rat after birth in x weeks.

1. What is the y-intercept of the regression line? Put it in


context to the problem.
2. After 84 days, what is the rats predicted weight (in lbs)?
1 pound = 454 grams
1. Is it right to predict the weight after 8 years? If so, why?
If not, why not?
1. 80 grams is the predicted weight at birth for the rats.
2. Change 84 days into weeks. 84 days = 12 weeks
ŷ = 80 + 35(12) 500 grams/ 454 g = 1.1 lbs
1. No, because that line would be too far out and the
measure would be off by too much.
Residuals (4 min)
● Residuals are the difference between the predicted y-value and the observed
y-value.
● Residual = y - ŷ
■ = Observed y - predicted y
● Go to the previous slide and find the residual for the rat if the actual weight
after 12 weeks was 750 grams.
Answer:
750-500 = 250 grams
NOTE: After finding all residuals, you
use the same x-values and your
residuals are your y-values for your
RESID plot.
What’s the point of a residual?
● After we find all the residuals, we will then decide if we can use these to show
a linear plot.
○ We plot all the residuals
■ USE CALCULATOR LATER
● If there is any type of pattern on the residual plot, we can not use a linear
model for the data set.
Can we use a linear model for data sets?
A NO
B. YES

C. YES
Least Squares Regression Line
This is in terms of y on x. It makes the sum of the squared residuals as small as
possible.

WHAT DOES THAT MEAN????

● The vertical line from data points to regression line as small as possible
○ Square the residual
○ Add them all up
○ Least possible answer
CALCULATOR TIME!!!! (7)
STEPS TO GRAPH Linear Regression

1. Enter data in L1 and L2


2. Graph Scatter plot
a. Refer to previous lessons to learn how to do that
3. Press STAT
a. CALC
b. LinReg (ax+b) option 4
4. Store in equation Y1
a. Vars
b. Y-vars
c. Function Y1
5. THEN GRAPH
CALCULATOR TIME!!! (3)
Steps to graph Residual Plot

1. Follow steps from Previous Slide


2. Highlight L3
a. Press 2nd stat
b. SELECT RESID List
3. Turn off Plot 1/ Turn on Plot 2
LAST TOPIC!!!!! Sx Residuals
This would be called the “typical” prediction error.

In order to find this, you first need to input the data. Let’s use the same data set
from a few slides ago.

1. Press Stat ANSWER: Sx Resid = 2.32


a. Calc
b. 2-vars Stat The typical prediction error between
c. Press enter and Calculate family size and total income is about
$2.32 when predicting annual income.
2. Interpret it in Context

Das könnte Ihnen auch gefallen