Download presentation

Presentation is loading. Please wait.

Published byConrad Lyons Modified over 4 years ago

1
Chapter 5 Regression

2
u Objective: To quantify the linear relationship between an explanatory variable (x) and response variable (y). u We can then predict the average response for all subjects with a given value of the explanatory variable. Linear Regression

3
Prediction via Regression Line Number of new birds and Percent returning Example: predicting number (y) of new adult birds that join the colony based on the percent (x) of adult birds that return to the colony from the previous year.

4
Correlation tells us about strength (scatter) and direction of the linear relationship between two quantitative variables. In addition, we would like to have a numerical description of how both variables vary together. For instance, is one variable increasing faster than the other one? And we would like to make predictions based on that numerical description. But which line best describes our data?

5
Least Squares u Used to determine the “best” line u We want the line to be as close as possible to the data points in the vertical (y) direction (since that is what we are trying to predict) u Least Squares: use the line that minimizes the sum of the squares of the vertical distances of the data points from the line

6
Distances between the points and line are squared so all are positive values. This is done so that distances can be properly added (Pythagoras). The regression line The least-squares regression line is the unique line such that the sum of the squared vertical (y) distances between the data points and the line is the smallest possible.

7
Least Squares Regression Line u Regression equation: y = a + bx ^ –x is the value of the explanatory variable –“y-hat” is the average value of the response variable (predicted response for a value of x) –note that a and b are just the intercept and slope of a straight line –note that r and b are not the same thing, but their signs will agree

8
Prediction via Regression Line Number of new birds and Percent returning u The regression equation is y-hat = 31.9343 0.3040x –y-hat is the average number of new birds for all colonies with percent x returning u For all colonies with 60% returning, we predict the average number of new birds to be 13.69: 31.9343 (0.3040)(60) = 13.69 birds u Suppose we know that an individual colony has 60% returning. What would we predict the number of new birds to be for just that colony?

9
^ u Regression equation: y = a + bx Regression Line Calculation where s x and s y are the standard deviations of the two variables, and r is their correlation

10
Regression Calculation Case Study Per Capita Gross Domestic Product and Average Life Expectancy for Countries in Western Europe

11
CountryPer Capita GDP (x)Life Expectancy (y) Austria21.477.48 Belgium23.277.53 Finland20.077.32 France22.778.63 Germany20.877.17 Ireland18.676.39 Italy21.578.51 Netherlands22.078.15 Switzerland23.878.99 United Kingdom21.277.37 Regression Calculation Case Study

12
Linear regression equation: y = 68.716 + 0.420x ^ Regression Calculation Case Study

13
Facts about least-squares regression 1. The distinction between explanatory and response variables is essential in regression. 2. There is a close connection between correlation and the slope of the least-squares line. 3. The least-squares regression line always passes through the point 4. The correlation r describes the strength of a straight-line relationship. The square of the correlation, r 2, is the fraction of the variation in the values of y that is explained by the least-squares regression of y on x.

14
Coefficient of Determination (R 2 ) u Measures usefulness of regression prediction u R 2 (or r 2, the square of the correlation): measures what fraction of the variation in the values of the response variable (y) is explained by the regression line v r=1: R 2 =1:regression line explains all (100%) of the variation in y v r=.7: R 2 =.49:regression line explains almost half (50%) of the variation in y

15
Residuals u A residual is the difference between an observed value of the response variable and the value predicted by the regression line: residual = y y ^

16
Residuals u A residual plot is a scatterplot of the regression residuals against the explanatory variable –used to assess the fit of a regression line –look for a “random” scatter around zero

17
Case Study Gesell Adaptive Score and Age at First Word

18
Residual Plot: Case Study Gesell Adaptive Score and Age at First Word

19
The x-axis in a residual plot is the same as on the scatterplot. The line on both plots is the regression line. Only the y-axis is different.

20
Residuals are randomly scattered—good! A curved pattern—means the relationship you are looking at is not linear. A change in variability across plot is a warning sign. You need to find out why it is and remember that predictions made in areas of larger variability will not be as good.

21
Outliers and Influential Points u An outlier is an observation that lies far away from the other observations –outliers in the y direction have large residuals –outliers in the x direction are often influential for the least-squares regression line, meaning that the removal of such points would markedly change the equation of the line

22
Outliers: Case Study Gesell Adaptive Score and Age at First Word From all the data r 2 = 41% r 2 = 11% After removing child 18

23
Cautions about Correlation and Regression u only describe linear relationships u are both affected by outliers u always plot the data before interpreting u beware of extrapolation –predicting outside of the range of x u beware of lurking variables –have important effect on the relationship among the variables in a study, but are not included in the study u association does not imply causation

24
Caution: Beware of Extrapolation u Sarah’s height was plotted against her age u Can you predict her height at age 42 months? u Can you predict her height at age 30 years (360 months)?

25
Caution: Beware of Extrapolation u Regression line: y-hat = 71.95 +.383 x u height at age 42 months? y-hat = 88 u height at age 30 years? y-hat = 209.8 –She is predicted to be 6’ 10.5” at age 30.

26
Caution: Beware of Lurking Variables A lurking variable is a variable not included in the study design that does have an effect on the variables studied. Lurking variables can falsely suggest a relationship. What is the lurking variable in these examples? How could you answer if you didn’t know anything about the topic? u Strong positive association between the number firefighters at a fire site and the amount of damage a fire does –Negative association between moderate amounts of wine drinking and death rates from heart disease in developed nations

27
Even very strong correlations may not correspond to a real causal relationship (changes in x actually causing changes in y). (correlation may be explained by a lurking variable) Caution: Correlation Does Not Imply Causation

28
Social Relationships and Health u Does lack of social relationships cause people to become ill? (there was a strong correlation) u Or, are unhealthy people less likely to establish and maintain social relationships? (reversed relationship) u Or, is there some other factor that predisposes people both to have lower social activity and become ill? Caution: Correlation Does Not Imply Causation

29
Evidence of Causation u A properly conducted experiment establishes the connection (chapter 8) u Other considerations: –The association is strong –The association is consistent v The connection happens in repeated trials v The connection happens under varying conditions –Higher doses are associated with stronger responses –Alleged cause precedes the effect in time –Alleged cause is plausible (reasonable explanation)

Similar presentations

© 2020 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google