Successfully reported this slideshow.
Upcoming SlideShare
×

# Chapter13

4,444 views

Published on

Published in: Technology
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Thanks for your great work ! I used your slides in my class.

Are you sure you want to  Yes  No

### Chapter13

1. 1. Chapter 13 Simple Linear Regression & Correlation Inferential Methods
2. 2. <ul><li>Consider the two variables x and y. A deterministic relationship is one in which the value of y (the dependent variable) is described by some formula or mathematical notation such as y = f(x), y = 3 + 2 x or </li></ul><ul><li>y = 5e -2x where x is the dependent variable. </li></ul>Deterministic Models
3. 3. <ul><li>A description of the relation between two variables x and y that are not deterministically related can be given by specifying a probabilistic model . </li></ul><ul><li>The general form of an additive probabilistic model allows y to be larger or smaller than f(x) by a random amount, e . </li></ul><ul><li>The model equation is of the form </li></ul>Probabilistic Models Y = deterministic function of x + random deviation = f(x) + e
4. 4. Probabilistic Models Deviations from the deterministic part of a probabilistic model e=-1.5
5. 5. Simple Linear Regression Model The simple linear regression model assumes that there is a line with vertical or y intercept a and slope b, called the true or population regression line. When a value of the independent variable x is fixed and an observation on the dependent variable y is made, y =  +  x + e Without the random deviation e , all observed points (x, y) points would fall exactly on the population regression line. The inclusion of e in the model equation allows points to deviate from the line by random amounts.
6. 6. Simple Linear Regression Model 0 0 x = x 1 x = x 2 e 2 Observation when x = x 1 (positive deviation) e 2 Observation when x = x 2 (positive deviation)  = vertical intercept Population regression line (Slope  )
7. 7. Basic Assumptions of the Simple Linear Regression Model <ul><li>The distribution of e at any particular x value has mean value 0 ( µ e = 0). </li></ul><ul><li>The standard deviation of e (which describes the spread of its distribution) is the same for any particular value of x. This standard deviation is denoted by  . </li></ul><ul><li>The distribution of e at any particular x value is normal. </li></ul><ul><li>The random deviations e 1 , e 2 , …, e n associated with different observations are independent of one another. </li></ul>
8. 8. More About the Simple Linear Regression Model and (standard deviation of y for fixed x) =  . For any fixed x value, y itself has a normal distribution.
9. 9. Interpretation of Terms <ul><li>The slope  of the population regression line is the mean (average) change in y associated with a 1-unit increase in x. </li></ul><ul><li>The vertical intercept  is the height of the population line when x = 0. </li></ul><ul><li>The size of  determines the extent to which the (x, y) observations deviate from the population line. </li></ul>Small  Large 
10. 10. Illustration of Assumptions
11. 11. Estimates for the Regression Line The point estimates of  , the slope, and  , the y intercept of the population regression line, are the slope and y intercept, respectively, of the least squares line. That is,
12. 12. Interpretation of y = a + bx <ul><li>Let x* denote a specific value of the predictor variable x. The a + bx* has two interpetations: </li></ul><ul><ul><li>a + bx* is a point estimate of the mean y value when x = x*. </li></ul></ul><ul><ul><li>a + bx* is a point prediction of an individual y value to be observed when x = x*. </li></ul></ul>
13. 13. Example The following data was collected in a study of age and fatness in humans. * Mazess, R.B., Peppler, W.W., and Gibbons, M. (1984) Total body composition by dual-photon ( 153 Gd) absorptiometry. American Journal of Clinical Nutrition , 40 , 834-839 One of the questions was, “What is the relationship between age and fatness?”
14. 14. Example
15. 15. Example
16. 16. Example
17. 17. Example A point estimate for the %Fat for a human who is 45 years old is If 45 is put into the equation for x, we have both an estimated %Fat for a 45 year old human or an estimated average %Fat for 45 year old humans The two interpretations are quite different.
18. 18. Example A plot of the data points along with the least squares regression line created with Minitab is given to the right.
19. 19. Terminology
20. 20. Definition formulae The total sum of squares , denoted by SSTo , is defined as The residual sum of squares , denoted by SSResid , is defined as
21. 21. Calculation Formulae Recalled SSTo and SSResid are generally found as part of the standard output from most statistical packages or can be obtained using the following computational formulas:
22. 22. Coefficient of Determination <ul><li>The coefficient of determination , denoted by r 2 , gives the proportion of variation in y that can be attributed to an approximate linear relationship between x and y. </li></ul>
23. 23. Estimated Standard Deviation, s e The statistic for estimating the variance  2 is where
24. 24. Estimated Standard Deviation, s e The estimate of  is the estimated standard deviation The number of degrees of freedom associated with estimating   or  in simple linear regression is n - 2.
25. 25. Example continued
26. 26. Example continued
27. 27. Example continued With r 2 = 0.627 or 62.7%, we can say that 62.7% of the observed variation in %Fat can be attributed to the probabilistic linear relationship with human age. The magnitude of a typical sample deviation from the least squares line is about 5.75(%) which is reasonably large compared to the y values themselves. This would suggest that the model is only useful in the sense of provide gross “ballpark” estimates for %Fat for humans based on age.
28. 28. Properties of the Sampling Distribution of b <ul><li>The mean value of b is  . Specifically, </li></ul><ul><ul><ul><li> b =  and hence b is an unbiased statistic for estimating  </li></ul></ul></ul>When the four basic assumptions of the simple linear regression model are satisfied, the following conditions are met: <ul><li>The statistic b has a normal distribution (a consequence of the error e being normally distributed) </li></ul><ul><li>The standard deviation of the statistic b is </li></ul>
29. 29. Estimated Standard Deviation of b The estimated standard deviation of the statistic b is When then four basic assumptions of the simple linear regression model are satisfied, the probability distribution of the standardized variable is the t distribution with df = n - 2
30. 30. Confidence interval for  When then four basic assumptions of the simple linear regression model are satisfied, a confidence interval for  , the slope of the population regression line, has the form b  (t critical value)  s b where the t critical value is based on df = n - 2.
31. 31. Example continued Recall A 95% confidence interval estimate for  is
32. 32. Example continued Based on sample data, we are 95% confident that the true mean increase in %Fat associated with a year of age is between 0.324% and 0.772%. A 95% confidence interval estimate for  is
33. 33. Example continued The regression equation is % Fat y = 3.22 + 0.548 Age (x) Predictor Coef SE Coef T P Constant 3.221 5.076 0.63 0.535 Age (x) 0.5480 0.1056 5.19 0.000 S = 5.754 R-Sq = 62.7% R-Sq(adj) = 60.4% Analysis of Variance Source DF SS MS F P Regression 1 891.87 891.87 26.94 0.000 Residual Error 16 529.66 33.10 Total 17 1421.54 Minitab output looks like Regression Analysis: % Fat y versus Age (x) Regression line residual df = n -2 SSResid SSTo Estimated slope b Estimated y intercept a
34. 34. Hypothesis Tests Concerning  Null hypothesis: H 0 :  = hypothesized value
35. 35. Hypothesis Tests Concerning  <ul><li>Alternate hypothesis and finding the P-value: </li></ul><ul><li>H a :  > hypothesized value </li></ul><ul><ul><ul><li>P-value = Area under the t curve with n - 2 degrees of freedom to the right of the calculated t </li></ul></ul></ul><ul><li>H a :  < hypothesized value </li></ul><ul><ul><ul><li>P-value = Area under the t curve with n - 2 degrees of freedom to the left of the calculated t </li></ul></ul></ul>
36. 36. Hypothesis Tests Concerning  <ul><li>H a :   hypothesized value </li></ul><ul><ul><ul><li>If t is positive, P-value = 2 (Area under the t curve with n - 2 degrees of freedom to the right of the calculated t) </li></ul></ul></ul><ul><ul><ul><li>If t is negative, P-value = 2 (Area under the t curve with n - 2 degrees of freedom to the left of the calculated t) </li></ul></ul></ul>
37. 37. Hypothesis Tests Concerning  <ul><li>Assumptions: </li></ul><ul><li>The distribution of e at any particular x value has mean value 0 (  e = 0) </li></ul><ul><li>The standard deviation of e is  , which does not depend on x </li></ul><ul><li>The distribution of e at any particular x value is normal </li></ul><ul><li>The random deviations e 1 , e 2 , … , e n associated with different observations are independent of one another </li></ul>
38. 38. Hypothesis Tests Concerning  Quite often the test is performed with the hypotheses H 0 :  = 0 vs. H a :   0 This particular form of the test is called the model utility test for simple linear regression. The null hypothesis specifies that there is no useful linear relationship between x and y, whereas the alternative hypothesis specifies that there is a useful linear relationship between x and y. The test statistic simplifies to and is called the t ratio .
39. 39. Example Consider the following data on percentage unemployment and suicide rates. * Smith, D. (1977) Patterns in Human Geography , Canada: Douglas David and Charles Ltd., 158.
40. 40. Example The plot of the data points produced by Minitab follows
41. 41. Example
42. 42. Example Some basic summary statistics
43. 43. Example Continuing with the calculations
44. 44. Example Continuing with the calculations
45. 45. Example
46. 46. Example - Model Utility Test <ul><li> = the true average change in suicide rate associated with an increase in the unemployment rate of 1 percentage point </li></ul><ul><li>H 0 :  = 0 </li></ul><ul><li>H a :  0 </li></ul><ul><li> has not been preselected. We shall interpret the observed level of significance (P-value) </li></ul><ul><li>Test statistic: </li></ul>
47. 47. Example - Model Utility Test <ul><li>Assumptions: The following plot (Minitab) of the data shows a linear pattern and the variability of points does not appear to be changing with x. Assuming that the distribution of errors (residuals) at any given x value is approximately normal, the assumptions of the simple linear regression model are appropriate. </li></ul>
48. 48. Example - Model Utility Test <ul><li>P-value : The table of tail areas for t-distributions only has t values  4, so we can see that the corresponding tail area is < 0.002. Since this is a two-tail test the P-value < 0.004. (Actual calculation gives a P-value = 0.002) </li></ul><ul><li>Calculation: </li></ul>
49. 49. Example - Model Utility Test <ul><li>Conclusion : </li></ul><ul><li>Even though no specific significance level was chosen for the test, with the P-value being so small (< 0.004) one would generally reject the null hypothesis that  = 0 and conclude that there is a useful linear relationship between the % unemployed and the suicide rate. </li></ul>
50. 50. Example - Minitab Output Regression Analysis: Suicide Rate (y) versus Percentage Unemployed (x) The regression equation is Suicide Rate (y) = - 93.9 + 59.1 Percentage Unemployed (x) Predictor Coef SE Coef T P Constant -93.86 51.25 -1.83 0.100 Percenta 59.05 14.24 4.15 0.002 S = 36.06 R-Sq = 65.7% R-Sq(adj) = 61.8% T value for Model Utility Test H 0 :  = 0 H a :   0 P-value
51. 51. Residual Analysis <ul><li>The simple linear regression model equation is y =  +  x + e where e represents the random deviation of an observed y value from the population regression line  +  x . </li></ul><ul><li>Key assumptions about e </li></ul><ul><ul><li>At any particular x value, the distribution of e is a normal distribution </li></ul></ul><ul><ul><li>At any particular x value, the standard deviation of e is  , which is constant over all values of x. </li></ul></ul>
52. 52. Residual Analysis To check on these assumptions, one would examine the deviations e 1 , e 2 , …, e n . Generally, the deviations are not known, so we check on the assumptions by looking at the residuals which are the deviations from the estimated line, a + bx. The residuals are given by
53. 53. Standardized Residuals Recall: A quantity is standardized by subtracting its mean value and then dividing by its true (or estimated) standard deviation. For the residuals, the true mean is zero (0) if the assumptions are true. The estimated standard deviation of a residual depends on the x value. The estimated standard deviation of the i th residual, , is given by
54. 54. Standardized Residuals As you can see from the formula for the estimated standard deviation the calculation of the standardized residuals is a bit of a calculational nightmare. Fortunately, most statistical software packages are set up to perform these calculations and do so quite proficiently.
55. 55. Standardized Residuals - Example Consider the data on percentage unemployment and suicide rates Notice that the standardized residual for Pittsburgh is -2.50, somewhat large for this size data set.
56. 56. Example Pittsburgh This point has an unusually high residual
57. 57. Normal Plots Notice that both of the normal plots look similar. If a software package is available to do the calculation and plots, it is preferable to look at the normal plot of the standardized residuals. In both cases, the points look reasonable linear with the possible exception of Pittsburgh, so the assumption that the errors are normally distributed seems to be supported by the sample data.
58. 58. More Comments The fact that Pittsburgh has a large standardized residual makes it worthwhile to look at that city carefully to make sure the figures were reported correctly. One might also look to see if there are some reasons that Pittsburgh should be looked at separately because some other characteristic distinguishes it from all of the other cities. Pittsburgh does have a large effect on model.
59. 59. Visual Interpretation of Standardized Residuals This plot is an example of a satisfactory plot that indicates that the model assumptions are reasonable.
60. 60. Visual Interpretation of Standardized Residuals This plot suggests that a curvilinear regression model is needed.
61. 61. Visual Interpretation of Standardized Residuals This plot suggests a non-constant variance. The assumptions of the model are not correct.
62. 62. Visual Interpretation of Standardized Residuals This plot shows a data point with a large standardized residual.
63. 63. Visual Interpretation of Standardized Residuals This plot shows a potentially influential observation.
64. 64. Example - % Unemployment vs. Suicide Rate This plot of the residuals (errors) indicates some possible problems with this linear model. You can see a pattern to the points. Generally decreasing pattern to these points. Unusually large residual These two points are quite influential since they are far away from the others in terms of the % unemployed
65. 65. Properties of the Sampling Distribution of a + bx for a Fixed x Value <ul><li>Let x* denote a particular value of the independent variable x. When the four basic assumptions of the simple linear regression model are satisfied, the sampling distribution of the statistic a + bx* has the following properties: </li></ul><ul><ul><li>The mean value of a + bx* is  +  x*, so a + bx* is an unbiased statistic for estimating the average y value when x = x* </li></ul></ul>
66. 66. Properties of the Sampling Distribution of a + bx for a Fixed x Value <ul><li>The distribution of the statistic a + bx* is normal. </li></ul><ul><li>The standard deviation of the statistic a + bx* denoted by  a+bx* , is given by </li></ul>
67. 67. Addition Information about the Sampling Distribution of a + bx for a Fixed x Value The estimated standard deviation of the statistic a + bx*, denoted by s a+bx* , is given by When the four basic assumptions of the simple linear regression model are satisfied, the probability distribution of the standardized variable is the t distribution with df = n - 2.
68. 68. Confidence Interval for a Mean y Value When the four basic assumptions of the simple linear regression model are met, a confidence interval for a + bx* , the average y value when x has the value x*, is a + bx*  (t critical value)s a+bx* Where the t critical value is based on df = n -2. Many authors give the following equivalent form for the confidence interval.
69. 69. Confidence Interval for a Single y Value When the four basic assumptions of the simple linear regression model are met, a prediction interval for y* , a single y observation made when x has the value x*, has the form Where the t critical value is based on df = n -2. Many authors give the following equivalent form for the prediction interval.
70. 70. Example - Mean Annual Temperature vs. Mortality Data was collected in certain regions of Great Britain, Norway and Sweden to study the relationship between the mean annual temperature and the mortality rate for a specific type of breast cancer in women. * Lea, A.J. (1965) New Observations on distribution of neoplasms of female breast in certain European countries. British Medical Journal , 1 , 488-490
71. 71. Example - Mean Annual Temperature vs. Mortality Regression Analysis: Mortality index versus Mean annual temperature   The regression equation is Mortality index = - 21.8 + 2.36 Mean annual temperature   Predictor Coef SE Coef T P Constant -21.79 15.67 -1.39 0.186 Mean ann 2.3577 0.3489 6.76 0.000   S = 7.545 R-Sq = 76.5% R-Sq(adj) = 74.9%   Analysis of Variance   Source DF SS MS F P Regression 1 2599.5 2599.5 45.67 0.000 Residual Error 14 796.9 56.9 Total 15 3396.4   Unusual Observations Obs Mean ann Mortalit Fit SE Fit Residual St Resid 15 31.8 67.30 53.18 4.85 14.12 2.44RX   R denotes an observation with a large standardized residual X denotes an observation whose X value gives it large influence.
72. 72. Example - Mean Annual Temperature vs. Mortality The point has a large standardized residual and is influential because of the low Mean Annual Temperature.
73. 73. Example - Mean Annual Temperature vs. Mortality These are the x* values for which the above fits, standard errors of the fits, 95% confidence intervals for Mean y values and prediction intervals for y values given above. Predicted Values for New Observations   New Obs Fit SE Fit 95.0% CI 95.0% PI 1 53.18 4.85 ( 42.79, 63.57) ( 33.95, 72.41) X 2 60.72 3.84 ( 52.48, 68.96) ( 42.57, 78.88) 3 72.51 2.48 ( 67.20, 77.82) ( 55.48, 89.54) 4 83.34 1.89 ( 79.30, 87.39) ( 66.66, 100.02) 5 96.09 2.67 ( 90.37, 101.81) ( 78.93, 113.25) 6 99.16 3.01 ( 92.71, 105.60) ( 81.74, 116.57) X denotes a row with X values away from the center   Values of Predictors for New Observations   New Obs Mean ann 1 31.8 2 35.0 3 40.0 4 44.6 5 50.0 6 51.3
74. 74. Example - Mean Annual Temperature vs. Mortality 95% prediction interval for single y value at x = 45. (67.62,100.98) 95% confidence interval for Mean y value at x = 40. (67.20, 77.82)
75. 75. A Test for Independence in a Bivariate Normal Population Null hypothesis: H 0 :  = 0 Assumption: r is the correlation coefficient for a random sample from a bivariate normal population. Test statistic: The t critical value is based on df = n - 2
76. 76. A Test for Independence in a Bivariate Normal Population Alternate hypothesis: H 0 :  > 0 (Positive dependence): P-value is the area under the appropriate t curve to the right of the computed t. Alternate hypothesis: H 0 :  < 0 (Negative dependence): P-value is the area under the appropriate t curve to the right of the computed t. <ul><li>Alternate hypothesis: H 0 :   0 (Dependence): </li></ul><ul><li>P-value is </li></ul><ul><ul><li>twice the area under the appropriate t curve to the left of the computed t value if t < 0 and </li></ul></ul><ul><ul><li>twice the area under the appropriate t curve to the right of the computed t value if t > 0 </li></ul></ul>
77. 77. Example Recall the data from the study of %Fat vs. Age for humans. There are 18 data points and a quick calculation of the Pierson correlation coefficient gives r = 0.79209. We will test to see if there is a dependence at the 0.05 significance level.
78. 78. Example <ul><li> = the correlation between % fat and age in the population from which the sample was selected </li></ul><ul><li>H 0 :  = 0 </li></ul><ul><li>H a :   0 </li></ul><ul><li> = 0.05 </li></ul><ul><li>Test statistic: </li></ul>
79. 79. Example <ul><li>Looking at the two normal plots, we can see it is not reasonable to assume that either the distribution of age nor the distribution of % fat are normal. (Notice, the data points deviate from a linear pattern quite substantially. Since neither is normal, we shall not continue with the test. </li></ul>
80. 80. Another Example Height vs. Joint Length The professor in an elementary statistics class wanted to explain correlation so he needed some bivariate data. He asked his class (presumably a random or representative sample of late adolescent humans) to measure the length of the metacarpal bone on the index finger of the right hand (in cm) and height (in ft). The data are provided on the next slide.
81. 81. Example - Height vs. Joint Length There are 17 data points and a quick calculation of the Pierson correlation coefficient gives r = 0.74908. We will test to see if the true population correlation coefficient is positive at the 0.05 level of significance.
82. 82. Example - Height vs. Joint Length <ul><li> = the true correlation between height and right index finger metacarpal joint in the population from which the sample was selected </li></ul><ul><li>H 0 :  = 0 </li></ul><ul><li>H a :  > 0 </li></ul><ul><li> = 0.05 </li></ul><ul><li>Test statistic: </li></ul>
83. 83. Example - Height vs. Joint Length <ul><li>Looking at the two normal plots, we can see it is reasonable to assume that the distribution of age and the distribution of % fat are both normal. (Notice, the data points follow a reasonably linear pattern. This appears to confirm the assumption that the sample is from a bivariate normal distribution. We will assume that the class was a random sample of young adults. </li></ul>
84. 84. Example - Height vs. Joint Length <ul><li>P-value: Looking on the table of tail areas for t curves under 15 degrees of freedom, 4.379 is off the bottom of the table, so P-value < 0.001. Minitab reports the P-value to be 0.001. </li></ul><ul><li>Conclusion: The P-value is smaller than  = 0.05, so we can reject H 0 . We can conclude that the true population correlation coefficient is greater then 0. I.e., the metacarpal bone is longer for taller people. </li></ul><ul><li>Calculation: </li></ul>