Anda di halaman 1dari 19

Chapter 8, Part 5

Linear Regression October 24, 2013

Copyright 2010 Pearson Education, Inc.

DO NOW PICK 2
1) If the model shown was a straight line, what would the correlation be? What would the residuals be? What variance would there be? 2) According to the BK model r=0.83, what is r^2? What percentage of the variability in total fat has been left in the residuals? 3) What happens when you make a histogram or normal probability plot of the residuals?

Copyright 2010 Pearson Education, Inc.

Slide 8 - 2

AIM AND HOMEWORK

How do we plot and understand linear regressions? Homework 19: Read and Complete Chapter 8 (Page 192-199), #50-54 Check Homework 18 with classmates Quiz 6 online due Sunday!!!

Copyright 2010 Pearson Education, Inc.

Slide 8 - 3

How Big Should R Be?

R2 is always between 0% and 100%. What makes a good R2 value depends on the kind of data you are analyzing and on what you want to do with it. The standard deviation of the residuals can give us more information about the usefulness of the regression by telling us how much scatter there is around the line.

Copyright 2010 Pearson Education, Inc.

Slide 8 - 4

Reporting R

Along with the slope and intercept for a regression, you should always report R2 so that readers can judge for themselves how successful the regression is at fitting the data. Statistics is about variation, and R2 measures the success of the regression model in terms of the fraction of the variation of y accounted for by the regression.

Copyright 2010 Pearson Education, Inc.

Slide 8 - 5

INDEPENDENT PRACTICE

Our regression model that predicts maximum wind speed in hurricanes based on the storms central pressure has R^2 = 77.3%. Question: What does it say about the regression model? An R^2 of 77.3% indicates that 77.3% of the variation in the maximum wind speed can be accounted by the hurricanes central pressure. Other factors, such as temperature and whether the storm in over water or land, may explain some of the remaining variation.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 6

Assumptions and Conditions

Quantitative Variables Condition: Regression can only be done on two quantitative variables (and not two categorical variables), so make sure to check this condition. Straight Enough Condition: The linear model assumes that the relationship between the variables is linear. A scatterplot will let you check that the assumption is reasonable.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 7

Assumptions and Conditions (cont.)

If the scatterplot is not straight enough, stop here. You cant use a linear model for any two variables, even if they are related. They must have a linear association or the model wont mean a thing. Some nonlinear relationships can be saved by reexpressing the data to make the scatterplot more linear.

Copyright 2010 Pearson Education, Inc.

Slide 8 - 8

Assumptions and Conditions (cont.)

Its a good idea to check linearity again after computing the regression when we can examine the residuals. Does the Plot Thicken? Condition: Look at the residual plot -- for the standard deviation of the residuals to summarize the scatter, the residuals should share the same spread. Check for changing spread in the residual scatterplot.

Copyright 2010 Pearson Education, Inc.

Slide 8 - 9

Assumptions and Conditions (cont.)

Outlier Condition: Watch out for outliers. Outlying points can dramatically change a regression model. Outliers can even change the sign of the slope, misleading us about the underlying relationship between the variables. If the data seem to clump or cluster in the scatterplot, that could be a sign of trouble worth looking into further.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 10

Reality Check: Is the Regression Reasonable?

Statistics dont come out of nowhere. They are based on data. The results of a statistical analysis should reinforce your common sense, not fly in its face. If the results are surprising, then either youve learned something new about the world or your analysis is wrong. When you perform a regression, think about the coefficients and ask yourself whether they make sense.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 11

What Can Go Wrong?

Dont fit a straight line to a nonlinear relationship. Beware extraordinary points (y-values that stand off from the linear pattern or extreme x-values). Dont extrapolate beyond the datathe linear model may no longer hold outside of the range of the data. Dont infer that x causes y just because there is a good linear model for their relationship association is not causation. Dont choose a model based on R2 alone.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 12

What have we learned?

When the relationship between two quantitative variables is fairly straight, a linear model can help summarize that relationship. The regression line doesnt pass through all the points, but it is the best compromise in the sense that it has the smallest sum of squared residuals.

Copyright 2010 Pearson Education, Inc.

Slide 8 - 13

What have we learned? (cont.)

The correlation tells us several things about the regression: The slope of the line is based on the correlation, adjusted for the units of x and y. For each SD in x that we are away from the x mean, we expect to be r SDs in y away from the y mean. Since r is always between 1 and +1, each predicted y is fewer SDs away from its mean than the corresponding x was (regression to the mean). 2 R gives us the fraction of the response accounted for by the regression model.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 14

What have we learned?

The residuals also reveal how well the model works. If a plot of the residuals against predicted values shows a pattern, we should re-examine the data to see why. The standard deviation of the residuals quantifies the amount of scatter around the line.

Copyright 2010 Pearson Education, Inc.

Slide 8 - 15

What have we learned? (cont.)

The linear model makes no sense unless the Linear Relationship Assumption is satisfied. Also, we need to check the Straight Enough Condition and Outlier Condition with a scatterplot. For the standard deviation of the residuals, we must make the Equal Variance Assumption. We check it by looking at both the original scatterplot and the residual plot for Does the Plot Thicken? Condition.
Copyright 2010 Pearson Education, Inc.

Slide 8 - 16

Independent Practice
Back to the regression of house price (in thousands of $) on house size (in thousands of square feet). The R^2 value is reported as 59.5% and the standard deviation of the residuals 53.79. 1. What does the R^2 value mean about the relationship of price and size? 2. Is the correlation of price and size positive or negative? How do you know? 3. If me measure house size size in square meters instead, would R^2 change? How would the slope of the line change? Explain. 4. You find that your house in Saratoga is worth $100,000 more then the regression model predicts. Should you be surprised as well as pleased?

Copyright 2010 Pearson Education, Inc.

Slide 8 - 17

Independent Practice Answers


1) Differences in size of houses account for about 59.5% of the variation in the house prices. 2) Its positive. The correlation and the slope have the same sign. 3) R^2 would not change but the slope would. Slope depends on the units used but the correlation doesnt. 4) No the standard deviation of the residuals is 53.79 thousand dollars. We shouldnt be surprised by any residual smaller then two standard deviations, and a residual of $100,000 is less than 2(53,790).

Copyright 2010 Pearson Education, Inc.

Slide 8 - 18

Conclusion

What have we learned today?

Copyright 2010 Pearson Education, Inc.

Slide 8 - 19

Anda mungkin juga menyukai