Find the Least Squares Regression Line and interpret its slope, y-intercept, and the coefficients of...

Post on 17-Jan-2016

217 views 1 download

Tags:

Transcript of Find the Least Squares Regression Line and interpret its slope, y-intercept, and the coefficients of...

Find the Least Squares Regression Line and interpret its slope, y-intercept, and the coefficients of correlation and determination

Justify the regression model using the scatterplot and residual plot

AP Statistics Objectives Ch8

Model Residuals Slope Regression to the meanInterceptR2

VocabularyLinear model

Predicted valueRegression line

Residual Plot Vocabulary

Chapter 7 Answers

Linear Regression Practice

Regression Line Notes

Chapter 8 Assignments

Chp 8 Part I Day 2 Example

Lurking Variable

Lurking Variable

Chapter 8 #1r

a) 10 2 20 3 0.5b) 2 0.06 7.2 1.2 -0.4c) 12 6 -0.8 200-4xd) 2.5 12 100 -100+50x

๐‘1=๐‘Ÿ ๐‘ ๐‘ฆ๐‘ ๐‘ฅ

๏ฟฝฬ‚๏ฟฝ=๐’ƒ๐ŸŽ+๐’ƒ๐Ÿ ๐’™

๏ฟฝฬ‚๏ฟฝ=๐Ÿ๐Ÿ .๐Ÿ“+๐ŸŽ .๐Ÿ•๐Ÿ“ ๐’™

Chapter 8 #1r

a) 10 2 20 3 0.5b) 2 0.06 7.2 1.2 -0.4c) 12 6 -0.8 200-4xd) 2.5 12 100 -100+50x๐‘1=

๐‘Ÿ ๐‘ ๐‘ฆ๐‘ ๐‘ฅ

๏ฟฝฬ‚๏ฟฝ=๐’ƒ๐ŸŽ+๐’ƒ๐Ÿ ๐’™

๏ฟฝฬ‚๏ฟฝ=๐Ÿ๐Ÿ .๐Ÿ“+๐ŸŽ .๐Ÿ•๐Ÿ“ ๐’™

Chapter 8 #1r

a) 10 2 20 3 0.5b) 2 0.06 7.2 1.2 -0.4c) 12 6 -0.8 200-4xd) 2.5 12 100 -100+50x

๐‘1=๐‘Ÿ ๐‘ ๐‘ฆ๐‘ ๐‘ฅ200-4x

๏ฟฝฬ‚๏ฟฝ=๐Ÿ๐Ÿ .๐Ÿ“+๐ŸŽ .๐Ÿ•๐Ÿ“ ๐’™๏ฟฝฬ‚๏ฟฝ=๐Ÿ๐Ÿ‘ .๐Ÿโˆ’๐Ÿ–๐’™

Chapter 8 #1r

a) 10 2 20 3 0.5b) 2 0.06 7.2 1.2 -0.4c) 12 6 -0.8 200-4xd) 2.5 1.2 100 -100+50x

๐‘1=๐‘Ÿ ๐‘ ๐‘ฆ๐‘ ๐‘ฅ

-100+50x

๏ฟฝฬ‚๏ฟฝ=๐Ÿ๐Ÿ .๐Ÿ“+๐ŸŽ .๐Ÿ•๐Ÿ“ ๐’™๏ฟฝฬ‚๏ฟฝ=๐Ÿ๐Ÿ‘ .๐Ÿโˆ’๐Ÿ–๐’™

๐Ÿ๐Ÿ“๐Ÿ๐Ÿ‘๐ŸŽ

Standardized Foot Length vs Height 2011

NOTE: (0,0) represents the mean of x and the mean of y.

๐‘ง h๐ป๐‘’๐‘–๐‘” ๐‘ก=0.84 ๐‘ง๐น๐‘œ๐‘œ๐‘ก๐‘†๐‘–๐‘ง๐‘’

Slope is the correlation

is part of all regression

lines

Regression Line for Standardized Values

=

is the predicted z-score for the response variable

is the z-score for the explanatory variable

๐‘Ÿ ๐‘–๐‘  h๐‘ก ๐‘’๐‘๐‘œ๐‘Ÿ๐‘Ÿ๐‘’๐‘™๐‘Ž๐‘ก๐‘–๐‘œ๐‘›๐‘๐‘œ๐‘’๐‘“๐‘“๐‘–๐‘๐‘–๐‘’๐‘›๐‘ก

Stand. Regres. Line will always pass through (.

Regression Line for

= +

is the predicted response variable

is the y-intercept

=

is the slope

=

Regression Line will always pass through (.

Explanatory or Response

Now interpret the R2. R2 = .697

According to the linear model, 69.7% of the variability in height is accounted for by variation in foot size.

Explanatory or Response 2011 data resulted in the following linear equation:

CAREFUL! The equations are not the same when you switch

explanatory and response variables.

Explanatory or Response 2011 data resulted in the following linear equation:

CAREFUL! The equations are not the same when you switch

explanatory and response variables.

Residual Plot Example

Residual Plot Example

REMEMBER: POSITIVE RESIDUALS are UNDERESTIMATES

e = y -

Residual Plot Example

NEGATIVE RESIDUALS are OVERESTIMATES

e = y -

Assignment

CHAPTER 8 Part I: pp. 189-190 #2,4,8&10,12&14Part II: pp. 190-192 #16,18,20,28&30

Chapter 7 Answers

a) #1 shows little or no associationb) #4 shows a negative associationc) #2 & #4 each show a linear

associationd) #3 shows a moderately strong,

curved associatione) #2 shows a very strong association

Chapter 7 Answers

a) -0.977b) 0.736c) 0.951d) -0.021

Chapter 7 Answers

The researcher should have plotted the data first. A strong, curved relationship may have a very low correlation. In fact, correlation is only a useful measure of the strength of a linear relationship.

Chapter 7 Answers

If the association between GDP and infant mortality is linear, a correlation of -0.772 shows a moderate, negative association.

Chapter 7 Answers

Continent is a categorical variable. Correlation measures the strength of linear associations between quantitative variables.

Chapter 7 Answers

Correlation must be between -1 and 1, inclusive. Correlation can never be 1.22.

Chapter 7 Answers

A correlation, no matter how strong, cannot prove a cause-and-effect relationship.

Chapter 8 Vocabulary1) Regression to the mean โ€“ each predicted response variable (y) tends to be closer to the mean (in standard deviations) than its corresponding explanatory variable (x)

Chapter 8 Vocabulary2) โ€“ predicted response variable

3) Residual โ€“ the difference between the actual response value and the predicted response value

e = y - 4) Overestimate โ€“ produces a negative residual

5) Underestimate โ€“ produces a positive residual

Chapter 8 Vocabulary6) Slope โ€“ rate of change given in units of the response variable (y) per unit of the explanatory variable (x)

7) intercept โ€“ response value when the explanatory value is zero

8) R2 โ€“ Must also be interpreted when describing a regression model (aka Coefficient of Determination)

Chapter 8 Vocabulary8) R2 โ€“ Must also be interpreted when describing a regression model

โ€œAccording to the linear model, _____% of the variability in _______ (response variable) is accounted for by variation in ________ (explanatory variable)โ€

The remaining variation is due to the residuals

Chapter 8 VocabularyCONDITIONS FOR USING A LINEAR REGRESSION

1) Quantitative Variables โ€“ Check the variables2) Straight Enough โ€“ Check the scatterplot 1st

(should be nearly linear) - Check the residual plot next

(should be random scatter)3) Outlier Condition-

- Any outliers need to be investigated

Chapter 8 Vocabulary9. Residual Plot - a scatterplot of the residuals and either x or

If you find a pattern in the Residual Plot, that means the residuals (errors) are predictable. If the residuals are predictable, then a better model exists. ---- LINEAR MODEL IS NOT APPROPRIATE. A residual plot is done with the RESIDUALS on the y-axis. On the x-axis, put the explanatory variable.

NOTE: Some software packages will put on the x-axis. This does not change the presence of (or lack of) of a pattern.

Chapter 8 Vocabulary9. Residual Plot - a scatterplot of the residuals and either x or

If you find a pattern in the Residual Plot, that means the residuals (errors) are predictable. If the residuals are predictable, then a better model exists. ---- LINEAR MODEL IS NOT APPROPRIATE. A residual plot is done with the RESIDUALS on the y-axis. On the x-axis, put the explanatory variable.

NOTE: Some software packages will put on the x-axis. This does not change the presence of (or lack of) of a pattern.

What is the ?

Did you say 2? Wrong. Try again.

It is actually because both (2)2 and (-2)2 is 4.

So what?

Important Note: The correlation is not given directly in this software package. You need to look in two places for it. Taking the square root of the โ€œR squaredโ€ (coefficient of determination) is not enough. You must look at the sign of the slope too. Positive slope is a positive r-value. Negative slope is a negative r-value.

So here you should note that the slope is negative. The correlation will be negative too. Since R2 is 0.482, r will be -0.694.

S/F Ratio

Grad Rate

-0.07861

Coefficient of Determination =

(0.694)2 = 0.4816

0.4816

With the linear regression model, 48.2% of the variability in airline fares is accounted for by the variation in distance of the flight.

๐‘1=๐‘Ÿ๐‘ ๐‘ฆ๐‘ ๐‘ฅ

ยฟ0.694๐Ÿ“๐Ÿ” .๐Ÿ‘๐Ÿ•497.8

ยฟ0.0786

There is an increase of 7.86 cents for every additional mile.

#10. Interpret the slope.

There is an increase of $7.86 for every additional 100 miles.

๐‘1=๐‘Ÿ๐‘ ๐‘ฆ๐‘ ๐‘ฅ

ยฟ0.694๐Ÿ“๐Ÿ” .๐Ÿ‘๐Ÿ•497.8

There is an increase of 7.86 cents for every additional mile.

#10. Interpret the slope.

There is an increase of $7.86 for every additional 100 miles.

244.33 = + (0.0786)(853.7)

๐‘1=0.0786

๐‘ฆ=๐‘0+๐‘1๐‘ฅ

244.33 โ€“ (0.0786)(853.7) =

#9. Interpret the y-intercept.

The model predicts a flight of zero miles will cost $177.23. The airline may have built in an initial cost to pay for some of its expenses.

177.2292=

๐‘1=0.0786

177.2292 + 0.0786Distance

๐‘1=0.0786

177.2292 + 0.0786Distance

177.2292 + 0.0786(200)

$192.95

177.2292 + 0.0786Distance

177.2292 + 0.0786(200)

$192.95

177.2292 + 0.0786(2000)

$334.43

8. Using those estimates, draw the line on the scatterplot.

177.2292 + 0.0786(200) = $192.95

177.2292 + 0.0786(2000) = $334.43

177.2292 + 0.0786Distance

177.2292 + 0.0786(1719)

$312.34

y โ€“

212 โ€“

-$100.34

12. In general, a positive residual means

13. In general, a negative residual means

The model underestimatedthe actual value.

The model overestimatedthe actual value.

A linear model should be appropriate, because

1) the scatterplot shows a nearly linear form and

2) the residual plot shows random scatter.

The coefficient of determination is .482, so

the coefficient of correlation is = .694. This shows a moderate strength in association for the model.

$150 for a flight of about 700 miles seems low compared to the other fares.

โ€œfareโ€ is the response variable. Not all software will call it the dependent variable.Always look for โ€œConstantโ€ and what is listed beside it. Here above it shows the column is for the โ€œvariableโ€ and below โ€œdistโ€ is the explanatory variable.

Recall:For y = 3x + 1 the coefficient of x is โ€˜3โ€™.For computer printouts this is the key column for your regression model.

Recall:For y = 3x + 1 the coefficient of x is โ€˜3โ€™.For computer printouts this is the key column for your regression model.

The โ€œCoefficientโ€ of the โ€œConstantโ€ is the y-intercept for your linear regression.

Recall:For y = 3x + 1 the coefficient of x is โ€˜3โ€™.For computer printouts this is the key column for your regression model.

The โ€œCoefficientโ€ of the โ€œConstantโ€ is the y-intercept for your linear regression.

The โ€œCoefficientโ€ of the variable โ€œdistโ€ is the slope for your linear regression.

177.215 + 0.078619distance

Recall:For y = 3x + 1 the coefficient of x is โ€˜3โ€™.For computer printouts this is the key column for your regression model.

The โ€œCoefficientโ€ of the โ€œConstantโ€ is the y-intercept for the linear regression.

The โ€œCoefficientโ€ of the variable โ€œdistโ€ is the slope for the linear regression.

177.215 + 0.078619distance

177.215 + 0.078619(1000)

5. Predict the airfare for a 1000-mile flight.

ยฟ $๐Ÿ๐Ÿ“๐Ÿ“ .๐Ÿ–๐Ÿ‘

Note: Even when we switchthe response and explanatory

variables, the linear modelis still appropriate.

-644.287 + 6.13101fare

R2 doesnโ€™t change, but the equation does.

-644.287 + 6.13101fare

-644.287 + 6.13101

= 924.2 miles

-644.287 + 6.13101fare

-644.287 + 6.13101

= 924.2 miles

8. Residual? e = y - = 924.2 โ€“ 1000 = -75.8

Chp 8 #17R squared = 92.4%

17a. What is the correlation between tar and nicotine? (NOTE: scatterplot shows a strong positive linear association.)

+ =

Chp 8 #17R squared = 92.4%

17b. What would you predict about the average nicotine content of cigarettes that are 2 standard deviations below average in tar content.

= r

r=

= 0 = -1.922

I would predict that the nicotine content would be 1.922 standard deviations below the average.

Chp 8 #17R squared = 92.4%

17c. If a cigarette is 1 standard deviation above average in nicotine content, what do you suspect is true about its tar content?

= r

r=

= 0 = 0.961

I would predict that the tar content would be 0.961 standard deviations above the average.