Linear Regression Linear Regression The Science of Predicting Outcome
Mar 26, 2015
Linear RegressionLinear Regression
The Science of Predicting Outcome
Least-Squares Regression
LSR is a method for finding a line that summarizes the relationship between two variables Regression line is a straight line that describes how a response variable y changes as an explanatory variable x changesWe often use a regression line to predict the value of y for a given value of x
LSRL: Least Square Regression Line
LSRL: Least Square Regression Line
SlopeSlopeY-interceptY-intercept
Example #1 - Finding the LSRL
• Consider the following data:
• With this data, find the LSRL
• Start by entering this data into list 1 and list 2
Shoe Size (men’s U.S.)
Height (in)
7 6410 6912 718 68
9.5 7110.5 7011 72
12.5 7413.5 7710 68
We need our graphing
calculator to solve the first
Case for today
Example #1 - Finding the LSRL
Example #1 - Finding the LSRL
Example #1 - Finding the LSRL
You should then see the results of the regression.
a=53.24b=1.65
r-squared=.8422r=.9177
This is the correlation coefficient for the
scatterplot!!!
This is the correlation coefficient for the
scatterplot!!!
Example #2 – Interpreting LSRLExample #2 – Interpreting LSRL
Interpreting the interceptWhen your shoe size is 0, you should be about 53.24 inches tall(Of course this does not make much sense in the context of the problem)
Interpreting the slopeFor each increase of 1 in the shoe size, we would expect the height to increase by 1.65 inches
Example #3 – Using LSRLExample #3 – Using LSRL
Making predictions
How tall might you expect someone to be who has a shoe size of 12.5?
Just plug in 12.5 for the shoe size above, so…
Height = 53.24+1.65 (12.5)=73.865 inches(this is a prediction and is therefore not exact.)
Student Number of Beers
Blood Alcohol Level
1 5 0.1
2 2 0.03
3 9 0.19
6 7 0.095
7 3 0.07
9 3 0.02
11 4 0.07
13 5 0.085
4 8 0.12
5 3 0.04
8 5 0.06
10 5 0.05
12 6 0.1
14 7 0.09
15 1 0.01
16 4 0.05
Practice
A. Find the strength of correlation between the 2 variables
B. Write the linear model for this data set
C. What will be your BAC level if you drink 6 bottle of beers.
Coefficients Coefficients aa and and bb
The equation of the least squares regression line is written as:
The slope is:
The intercept is: y-bar and x-bar are the mean y and x respectively
S-sub y and s-sub x are the sample standard deviations of y and x
(kinda like rise over run)
This table describes a study that recorded data on number of beers consumed and blood alcohol content (BAC) for 16 students. Here is some partial computer output from Minitab relating to these data:
(a) Use the computer output to write the equation of the least-squares line.(b) Interpret the slope and y intercept of the equation in this setting.(c) What blood alcohol level would your equation predict for a student who consumed 6 beers?
Y-intercept Slope
(a) If y = blood alcohol content (BAC) and x = number of beers, BAC = −0.01270 + 0.017964(number of beers).
(b) Slope: for every extra beer consumed, the BAC will increase by an average of 0.017964. Intercept: if no beers are consumed, the BAC will be, on average, −0.01270 (obviously meaningless).
(c) Predicted BAC = 0.0951
Answers
Here’s a computer generated output of 2 bivariate data. Write a linear
model that corresponds to these set of data.
y-hat = -0.124 + 0.0179(x)
Class Activity: Arm-span vs Height
“On predicting height given arm span “
Students will measure their height and arm span. Then they will write the LSRL from the
data they collected and predict a person’s arm span with their height.