{"id":563,"date":"2015-07-19T13:25:36","date_gmt":"2015-07-19T17:25:36","guid":{"rendered":"http:\/\/sites.berry.edu\/vbissonnette\/?page_id=563"},"modified":"2016-06-23T10:25:52","modified_gmt":"2016-06-23T14:25:52","slug":"regression-solution","status":"publish","type":"page","link":"https:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/regression\/regression-solution\/","title":{"rendered":"Regression Solution"},"content":{"rendered":"<h3>Example homework problem:<\/h3>\n<p>You work for an automotive magazine, and you are investigating the relationship between a car&#8217;s gas mileage (in miles-per-gallon) and the amount of horsepower produced by a car&#8217;s engine. You collect the following data:<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid black\">Automobile:<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">1<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">2<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">3<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">4<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">5<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">6<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">7<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">8<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">9<\/td>\n<td style=\"border-bottom: 1px solid black;width: 60px;text-align: center\">10<\/td>\n<\/tr>\n<tr>\n<td class=\"lf\">Horsepower:<\/td>\n<td style=\"text-align: center\">95<\/td>\n<td style=\"text-align: center\">135<\/td>\n<td style=\"text-align: center\">120<\/td>\n<td style=\"text-align: center\">167<\/td>\n<td style=\"text-align: center\">210<\/td>\n<td style=\"text-align: center\">146<\/td>\n<td style=\"text-align: center\">245<\/td>\n<td style=\"text-align: center\">110<\/td>\n<td style=\"text-align: center\">160<\/td>\n<td style=\"text-align: center\">130<\/td>\n<\/tr>\n<tr>\n<td class=\"lf\">MPG:<\/td>\n<td style=\"text-align: center\">37<\/td>\n<td style=\"text-align: center\">19<\/td>\n<td style=\"text-align: center\">26<\/td>\n<td style=\"text-align: center\">20<\/td>\n<td style=\"text-align: center\">24<\/td>\n<td style=\"text-align: center\">30<\/td>\n<td style=\"text-align: center\">15<\/td>\n<td style=\"text-align: center\">32<\/td>\n<td style=\"text-align: center\">23<\/td>\n<td style=\"text-align: center\">33<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Compute the best-fitting regression line (Y&#8217; = a + bx) for predicting a car&#8217;s gas mileage from its horsepower. Test to see if the slope of this regression line deviates significantly from zero (alpha = .05).<\/p>\n<hr \/>\n<p>The goal of your analysis is to <u>predict<\/u> the value of the outcome variable (Y: gas milage) given a value for the predictor variable (X: horsepower). To do this, we will compute the best-fitting regression line:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg1.png\" rel=\"attachment wp-att-966\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-966 aligncenter\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg1.png\" alt=\"reg1\" width=\"102\" height=\"22\" \/><\/a><\/p>\n<p>where the predicted value of Y is equal to the Y intercept (<i>a<\/i>) plus the product of a given value of X and the slope of the regression line (<i>b<\/i>).<\/p>\n<p>We will begin our computations by computing the <u>Variance\/Covariance Matrix<\/u>:<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid black;width: 120px\">Variable:<\/td>\n<td style=\"border-bottom: 1px solid black;width: 120px;text-align: center\">Horsepower<br \/>\n(X)<\/td>\n<td style=\"border-bottom: 1px solid black;width: 120px;text-align: center\">MPG<br \/>\n(Y)<\/td>\n<\/tr>\n<tr>\n<td class=\"lf\">Horsepower (X):<\/td>\n<td style=\"text-align: center\">2127.5111<\/td>\n<td style=\"text-align: center\">-243.4667<\/td>\n<\/tr>\n<tr>\n<td class=\"lf\">MPG (Y):<\/td>\n<td><\/td>\n<td style=\"text-align: center\">48.9889<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>which presents the variance of X (2127.51), the variance of Y (48.99), and the covariance between X and Y (-243.47). The variable means have also been added. For help computing the variance and covariance, see the documentation for <a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/explore-data\/\">descriptive statistics<\/a> and the documentation for <a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/correlation\/\">correlation<\/a>, respectively.<\/p>\n<p>The slope of the regression line is equal to:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg2.png\" rel=\"attachment wp-att-967\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-967\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg2.png\" alt=\"reg2\" width=\"307\" height=\"51\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg2.png 307w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg2-300x50.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg2-260x43.png 260w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/a><\/p>\n<p>The slope of the regression line (<i>b<\/i>) is equal to the covariance between the two variables divided by the variance of the predictor variable (X).<\/p>\n<p>Next, find the value of the Y intercept:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg3.png\" rel=\"attachment wp-att-968\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-968\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg3.png\" alt=\"reg3\" width=\"302\" height=\"77\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg3.png 302w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg3-300x76.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg3-260x66.png 260w\" sizes=\"auto, (max-width: 302px) 100vw, 302px\" \/><\/a><\/p>\n<p>If you would like help computing the means, then see the documentation for <a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/explore-data\/\">descriptive statistics<\/a>. Here is the completed regression equation:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg4.png\" rel=\"attachment wp-att-969\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-969\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg4.png\" alt=\"reg4\" width=\"259\" height=\"59\" \/><\/a><\/p>\n<p><b>Conduct hypothesis test<\/b>. We would like to know if the value of <i>b<\/i> is significantly different from zero. There are several approaches. For example, we can use the <i>t<\/i> test for the slope:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg5.png\" rel=\"attachment wp-att-970\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-970\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg5.png\" alt=\"reg5\" width=\"194\" height=\"46\" \/><\/a><\/p>\n<p>where <i>b<\/i> is the slope of the regression line, <i>S(b)<\/i> is the <u>Standard Error <\/u>of the slope, and <i>n<\/i> is the number of pairs of scores. The standard error of the slope is equal to:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg6.png\" rel=\"attachment wp-att-971\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-971\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg6.png\" alt=\"reg6\" width=\"145\" height=\"51\" \/><\/a><\/p>\n<p>The numerator of this formula refers to the <u>Variance of the Estimate<\/u>. This is computed with this formula:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg7.png\" rel=\"attachment wp-att-972\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-972\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg7.png\" alt=\"reg7\" width=\"428\" height=\"98\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg7.png 428w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg7-300x69.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg7-260x60.png 260w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/a><\/p>\n<p>Now that you have computed the Variance of the Estimate, you can compute<br \/>\nthe Standard Error of the Slope:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg8.png\" rel=\"attachment wp-att-973\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-973\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg8.png\" alt=\"reg8\" width=\"197\" height=\"128\" \/><\/a><\/p>\n<p>And now that you have the standard error of the slope, you can compute<br \/>\nthe value of your <i>t<\/i> test:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg9.png\" rel=\"attachment wp-att-974\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-974\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg9.png\" alt=\"reg9\" width=\"254\" height=\"46\" \/><\/a><\/p>\n<p>Recall that the <i>df<\/i> for this <i>t<\/i> test is equal to <i>n &#8211; 2<\/i>, where <i>n <\/i>is the number of pairs of scores. So, our <i>df<\/i> is equal to 8.<\/p>\n<p>Alpha was set at .05 and we will conduct a two-tailed test. When you consult your <a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/t.pdf\">table<\/a><br \/>\n<a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/t.pdf\"> of critical values<\/a> for <i>t<\/i>, you will find that if the absolute value of our obtained <i>t<\/i> is greater than 2.306, then we would conclude that the relationship between horsepower and gas mileage is significant &#8212; i.e., that the slope of the regression line is significantly different from zero.<\/p>\n<p>Since the obtained <i>t<\/i> (-3.25) is greater in absolute value than the critical <i>t<\/i> (2.306), we would conclude that there is a significant negative relationship between the horsepower level of the automobile and its gas mileage &#8212; i.e., the greater the horsepower, the lower the gas mileage.<\/p>\n<p><b>The Standardized Regression Coefficient<\/b>. The problem with <i>b<\/i> is that it will vary greatly in value depending on the scales of X and Y. It is not a useful descriptive statistic at all. So, we will typically convert <i>b<\/i> to the <u>Standardized Regression Coefficient<\/u> (\u03b2):<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg10.png\" rel=\"attachment wp-att-959\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-959\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg10.png\" alt=\"reg10\" width=\"363\" height=\"48\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg10.png 363w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg10-300x40.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg10-260x34.png 260w\" sizes=\"auto, (max-width: 363px) 100vw, 363px\" \/><\/a><\/p>\n<p>The standardized regression coefficient is equal to the slope of the regression line predicting Y from X after you have converted both variables to <u>Standard Scores<\/u> (Z scores). When you have one predictor, \u03b2 = <i>r<\/i>, the correlation coefficient. Think about it &#8212; the correlation coefficient is the slope of the regression line for predicting the Z of Y from the Z of X (in that case, the Y intercept will be 0). Don&#8217;t believe me? Convert both of your variables to Z scores and repeat your regression analysis &#8212; see how it turns out!<\/p>\n<p>Now that you have <i>r<\/i>, you can easily compute <i>r<\/i>\u00b2. <i>r<\/i>\u00b2 = -.7541\u00b2 = .57. This is the <u>Coefficient of Determination<\/u>; <i>r<\/i>\u00b2 represents the proportion of variance in Y that can be accounted for by variation in X.<\/p>\n<p><b>The Analysis of Variance<\/b>. We will now cover another approach that you can use to see if the slope (<i>b<\/i>) of your regression line is significantly different from zero &#8212; the Analysis of Variance (ANOVA).<\/p>\n<p>Our test statistic will be the value of the <i>F<\/i> statistic:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg11.png\" rel=\"attachment wp-att-960\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-960\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg11.png\" alt=\"reg11\" width=\"271\" height=\"46\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg11.png 271w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg11-260x44.png 260w\" sizes=\"auto, (max-width: 271px) 100vw, 271px\" \/><\/a><\/p>\n<p>The <i>F<\/i> statistic is equal to the ratio of the <i>Mean Square Due to Regression<\/i> divided by the <i>Mean Square Error<\/i>. n is equal to the number of observations (i.e., the number of automobiles), and k is equal to the number of predictor variables (i.e., one: gas mileage).<\/p>\n<p><b>Compute the test statistic<\/b>. When we conduct an ANOVA, we typically construct a <i>Source Table<\/i> that details the sources of your variance and the corresponding degrees<br \/>\nof freedom:<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid black;width: 80px\">Source<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">SS<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">df<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">MS<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">F<\/td>\n<\/tr>\n<tr>\n<td>Regression:<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1px solid black\">Error:<\/td>\n<td style=\"border-bottom: 1px solid black\"><\/td>\n<td style=\"border-bottom: 1px solid black\"><\/td>\n<td style=\"border-bottom: 1px solid black\"><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Total:<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>To facilitate your ANOVA, you should compute the following statistics: a) the sum of all of your outcome scores (\u03a3Y), the sum of all squared outcome scores (\u03a3Y\u00b2), and the\u00a0 number of observations (n). In our case, \u03a3Y=259, \u03a3Y\u00b2=7149, and n=10.<\/p>\n<p>Also, you should keep handy the value of <i>r<\/i>\u00b2 that we computed above (<i>r<\/i>\u00b2 = .5687).<\/p>\n<p>Now, you are ready to conduct an Analysis of Variance. The <i>Sum of Squares<\/i> (<i>SS<\/i>) Total is equal to:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg12.png\" rel=\"attachment wp-att-961\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-961\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg12.png\" alt=\"reg12\" width=\"232\" height=\"120\" \/><\/a><\/p>\n<p>The <i>SS<\/i> due to regression is equal to:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg13.png\" rel=\"attachment wp-att-962\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-962\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg13.png\" alt=\"reg13\" width=\"248\" height=\"78\" \/><\/a><\/p>\n<p>The <i>SS<\/i> error can be found by subtraction:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg14.png\" rel=\"attachment wp-att-963\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-963\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg14.png\" alt=\"reg14\" width=\"248\" height=\"74\" \/><\/a><\/p>\n<p>Add these values to your <i>Source Table<\/i>. The <i>df<\/i> Total is equal to the total number of observations minus one (n &#8211; 1). In our case this is: 10-1=9. The <i>df<\/i> Regression is equal to the number of predictors (k). In our case this is: 1. The <i>df<\/i> Error is equal to the number of observations minus two (n &#8211; 2). In our case this is: 10-2=8.<\/p>\n<p>Each Mean Square (<i>MS<\/i>) is equal to the SS for that source divided by the <i>df<\/i> for that source. In our case, <i>MS<\/i> Regression = 250.76 \/ 1 = 250.76, and <i>MS<\/i> Error = 190.15 \/ 8 = 23.77. Note that <i>MS<\/i> Error is <u>exactly<\/u> equal to the Variance of the Estimate that we computed earlier &#8212; 23.678. That&#8217;s what <i>MS<\/i> Error means &#8212; error variance in our predictions.<\/p>\n<p>Now you are ready to compute your test statistic. <i>F<\/i> is equal to:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg15.png\" rel=\"attachment wp-att-964\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-964\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg15.png\" alt=\"reg15\" width=\"358\" height=\"46\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg15.png 358w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg15-300x39.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg15-260x33.png 260w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><\/a><\/p>\n<p>Here is your completed <i>Source Table<\/i>:<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid black;width: 80px\">Source<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">SS<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">df<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">MS<\/td>\n<td style=\"border-bottom: 1px solid black;width: 80px;text-align: center\">F<\/td>\n<\/tr>\n<tr>\n<td>Regression:<\/td>\n<td style=\"text-align: center\">250.755<\/td>\n<td style=\"text-align: center\">1<\/td>\n<td style=\"text-align: center\">250.755<\/td>\n<td style=\"text-align: center\">10.55<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom: 1px solid black\">Error:<\/td>\n<td style=\"border-bottom: 1px solid black;text-align: center\">190.145<\/td>\n<td style=\"border-bottom: 1px solid black;text-align: center\">8<\/td>\n<td style=\"border-bottom: 1px solid black;text-align: center\">23.768<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Total:<\/td>\n<td style=\"text-align: center\">440.900<\/td>\n<td style=\"text-align: center\">9<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>Conduct hypothesis test<\/b>. In our study, the <i>F<\/i> statistic will have 1 and 8 <i>df<\/i>, and alpha = .05. If you look up the critical value of <i>F<\/i> in your <a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/f.pdf\">table of critical values<\/a>, you will see that if your obtained <i>F<\/i> is greater than 5.32, you would conclude that there is a significant relationship between X and Y (i.e., that a car&#8217;s horsepower is a significant predictor of the car&#8217;s gas mileage.<\/p>\n<p>Since the obtained <i>F<\/i> (10.55) is greater than the critical value for <i>F<\/i> (5.32), you would conclude that there <i>was<\/i> a significant linear relationship between horsepower and gas mileage.<\/p>\n<p><b>Effect Size<\/b>. We already know that the correlation between horsepower and gas mileage (<i>r<\/i>) is equal to -.75, and that <i>r<\/i>\u00b2 = .57. And, you know that <i>r<\/i>\u00b2 represents the proportion of variance in Y that can be accounted for by variance in X. So, we can say that knowing the horsepower of cars allows us to account for 57% of the variance in the cars&#8217; gas mileage scores.<\/p>\n<p>However, the problem with <i>r<\/i>\u00b2 is that it will systematically over-estimate the variance accounted for in your outcome variable; the smaller the sample size in your study, the more biased <i>r<\/i>\u00b2 will be. So, we typically prefer to compute an <u>unbiased estimate <\/u>of the variance accounted for. There is a simple solution &#8212; we will compute <u>Adjusted <i>R<\/i>\u00b2<\/u>:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg16.png\" rel=\"attachment wp-att-965\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-965\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg16.png\" alt=\"reg16\" width=\"396\" height=\"51\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg16.png 396w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg16-300x39.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg16-260x33.png 260w\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" \/><\/a><\/p>\n<p>The numerator of this formula is equal to the variance in your outcome variable (Y) minus the Variance of the Estimate (or <i>MS<\/i> Error). Then, divide this difference by the variance of Y.<\/p>\n<p>Notice that Adjusted <i>R<\/i>\u00b2 will always be a smaller value than was <i>r<\/i>\u00b2. We would conclude that using the horsepower of cars as a predictor variable can account for 51% of the variance in cars&#8217; gas mileage.<\/p>\n<hr \/>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/regression\/\">Return to Regression Procedure<\/a><\/p>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/\">Return to Table of Contents<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Example homework problem: You work for an automotive magazine, and you are investigating the relationship between a car&#8217;s gas mileage (in miles-per-gallon) and the amount of horsepower produced by a [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"parent":558,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"class_list":["post-563","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/comments?post=563"}],"version-history":[{"count":9,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/563\/revisions"}],"predecessor-version":[{"id":977,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/563\/revisions\/977"}],"up":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/558"}],"wp:attachment":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/media?parent=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}