Download presentation
Presentation is loading. Please wait.
Published byLogan Thornton Modified over 9 years ago
1
Chapter 8 Linear Regression
2
Fat Versus Protein: An Example 30 items on the Burger King menu:
3
linear model is an equation of a straight line through the data. – The points don’t all line up – straight line can summarize the general pattern
4
Residuals The scattered points are actual data, The corresponding values on the line are the predicted values, A residual is an error: difference between the actual and the predicted (the line)
5
A negative residual means the predicted value’s too big (an overestimate). A positive residual means the predicted value’s too small (an underestimate). A residual of zero means the line predicted exact
6
“Best Fit” Line We want the total residuals to be small as possible (minimizing error) The smaller the sum, the better the fit line Why the linear model is the line of best fit or regression line or least squares line The line always passes through the mean of the x variable and the mean of the y variable
7
Regression Line Algebra : Statistics: If the model is a good one, the data values will scatter closely around it.
8
slope (b 1 ) formula – In units of y per unit of x – Interpretation:
9
intercept (b 0 ) – In units of y – Usefulness of intercept:
10
Correlation and the Line Correlation coefficient tells us “how linear” So we will use r in the calculation of the slope Neg. Slope = Neg. Correlation Pos. Slope = Pos. Correlation Moving 1 st. dev. away from the mean in x moves us r st. dev. away from the mean in y (and visa versa) Ex: If you’re 1.5 st. dev. above avg. in GPA… Then how many st. dev. above on SAT?
11
Ways to find the Regression Line 1.Use the formulas for slope and intercept 2.Use raw data and run a stat -> calc -> LinReg 3.Use a given compute output
12
Burger King data fits the data well: – The equation is predict fat of a 30 g protein sandwich:
13
Check for same conditions: – Quantitative Variables – Straight Enough – No Outlier
14
To check whether a linear model is appropriate: 1.Look at the scatter plot of residuals vs. x var or y var (run a LinReg first) 2.If there is a pattern = linear model NOT appropriate 3.If there is NO pattern = linear model is appropriate
15
The residuals for the BK menu regression look appropriately boring:
16
The Residual St. Dev. The st. dev. of the residuals, s e, to be relatively small = spread/scatter around the line is small
17
R 2 —Coefficient of Strength It’s the square of r It’s a percent It’s between 0 and 100% The closer to 100 the stronger the linear model is at predicting Interpretation: “the % of the variation in y var that is explained by the x var” EX: Burger King Fat vs. Protein had R 2 = 69%.
18
Summary In order to use linear regression: 1.Check the original x, y scatter plot of straightness 2.Run a LinReg, then make a scatterplot of residuals vs x var….check for no pattern 3.Turn on diagnostic to check and run a LinReg to check R 2
19
Chapter 8 Assignment Pg: 192: #1-11 odd, 19-23 odd, 27, 31, 35, 37, 45, 49
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.