{"id":558,"date":"2015-07-19T13:13:55","date_gmt":"2015-07-19T17:13:55","guid":{"rendered":"http:\/\/sites.berry.edu\/vbissonnette\/?page_id=558"},"modified":"2016-06-23T10:50:23","modified_gmt":"2016-06-23T14:50:23","slug":"regression","status":"publish","type":"page","link":"https:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/regression\/","title":{"rendered":"Regression"},"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<p>If you would like some help with the hand-written solution to this problem, then <a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/regression\/regression-solution\/\">click here<\/a>.<\/p>\n<hr \/>\n<p>Enter these data into the first two columns of <i>Stats Homework&#8217;s <\/i>data manager and rename the variables. Your screen should look like this:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/corr6.png\" rel=\"attachment wp-att-650\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-650\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/corr6.png\" alt=\"corr6\" width=\"917\" height=\"693\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/corr6.png 917w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/corr6-300x227.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/corr6-768x580.png 768w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/corr6-260x196.png 260w\" sizes=\"auto, (max-width: 917px) 100vw, 917px\" \/><\/a><\/p>\n<p>Make sure to double-check and save your data. To conduct your analysis, pull down the <b>Analyze<\/b> menu, choose <b>Tests of Relationship<\/b>, and then choose <b>Linear Regression<\/b>. You will be presented with\u00a0this dialog:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg17.png\" rel=\"attachment wp-att-984\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-984\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg17.png\" alt=\"reg17\" width=\"571\" height=\"365\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg17.png 571w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg17-300x192.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg17-260x166.png 260w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/a><\/p>\n<p>Select Horsepower as your X (predictor) variable, and then MPG as your Y (outcome) variable. \u00a0Then, check all the output options and click\u00a0<strong>Compute<\/strong>.<\/p>\n<h4>Basic Output<\/h4>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg18.png\" rel=\"attachment wp-att-978\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-978\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg18.png\" alt=\"reg18\" width=\"468\" height=\"419\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg18.png 468w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg18-300x269.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg18-260x233.png 260w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/a><\/p>\n<p><b>Descriptive Statistics<\/b>. Basic descriptive statistics are covered on the page for the <a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/explore-data\/\">explore procedure<\/a> and the <a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/correlation\/\">correlation procedure<\/a>.<\/p>\n<p><b>Regression Equation<\/b>. Here, you will see a formal statement of your regression equation: Y&#8217; = a + bx. As noted here, you will see that each predicted value of Y, and each error in prediction (residual) has been written back into your data set.<\/p>\n<p><b>Regression Parameters.<\/b>These statistics will help you understand whether or not your regression parameters &#8211;a and b&#8211; deviate significantly from zero.<\/p>\n<ul>\n<li>Estimates: Y Int. (a) (43.27): this is the Y intercept (a) from the regression equation. Slope (b) (-.1144): this is the slope (b) of the regression equation.<\/li>\n<li>Std Err: (5.57, .035): these ares the standard errors of the intercept and slope. t (7.77, -3.25): these are the values of the <i>t<\/i> test statistics for the intercept and the slope. They are equal to the parameters divided by their respective standard errors.<\/li>\n<li>p (2-tail) (.00, .012): these are the significance levels of the <i>t<\/i> tests.<\/li>\n<\/ul>\n<h4>Optional Output<\/h4>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg19.png\" rel=\"attachment wp-att-979\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-979\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg19.png\" alt=\"reg19\" width=\"311\" height=\"90\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg19.png 311w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg19-300x87.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg19-260x75.png 260w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/a><\/p>\n<p><b>Confidence Intervals for the Slope (b)<\/b>. You are given the 95% and 99% confidence intervals for the population slope, based on your sample <i>b<\/i>. The 95% confidence interval tells you that, with 95% certainty, you would estimate the population slope to be between -.20 and -.03.<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg20.png\" rel=\"attachment wp-att-980\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-980\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg20.png\" alt=\"reg20\" width=\"487\" height=\"151\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg20.png 487w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg20-300x93.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg20-260x81.png 260w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/a><\/p>\n<p><b>ANOVA Source Table<\/b>. You have two sources of variance: variance accounted for in Y by the regression line, and variance not accounted for by the regression line (Error). Each variance component is associated with its own sum of squares (SS), degrees of freedom (df), and mean square (MS).<\/p>\n<p><i>F<\/i> is equal to MS(Regression) \/ MS(Error) (10.55). Note that <i>F <\/i>will be exactly equal to <i>t<\/i>\u00b2. Next to the <i>F<\/i> statistic is <i>p<\/i> &#8212; the chance probability \/ significance level of your result (.012). Also note that the <i>p<\/i> value for the <i>F<\/i> test will be exactly equal to the <i>p<\/i> value for the <i>t<\/i> test.<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg21.png\" rel=\"attachment wp-att-981\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-981\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg21.png\" alt=\"reg21\" width=\"275\" height=\"105\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg21.png 275w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg21-260x99.png 260w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/a><\/p>\n<p><b>Effect Size Statistics<\/b>. These statistics describe the magnitude of the relationship between your predictor and outcome variables:<\/p>\n<ul>\n<li>r\u00b2 (.57): this is the Coefficient of Determination. <i>r<\/i>\u00b2 represents the proportion of variance in the two variables that is shared &#8212; i.e., the proportion of variance in gas milage (Y) that can be accounted for by horsepower (X).<\/li>\n<li>adj r\u00b2 (.51): this is the Adjusted Coefficient of Determination. It represents an unbiased estimate of the variance accounted for (i.e., it controls for sample size).<\/li>\n<li>r (-0.75): This is equal to the Correlation Coefficient.<\/li>\n<li><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg22.png\" rel=\"attachment wp-att-982\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-982\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg22.png\" alt=\"reg22\" width=\"487\" height=\"162\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg22.png 487w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg22-300x100.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg22-260x86.png 260w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg23.png\" rel=\"attachment wp-att-983\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-983\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg23.png\" alt=\"reg23\" width=\"694\" height=\"531\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg23.png 694w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg23-300x230.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg23-260x199.png 260w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Scatter Plot<\/strong>. \u00a0You will be presented with a basic scatter plot of your data. \u00a0Above, I added the regression line to the plot.<\/p>\n<p>One of the assumptions of the regression analysis is that your residuals will be randomly distributed relative to X. \u00a0You can use the options to display a residual plot, which will help you to visually assess the validity of this assumption:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg24.png\" rel=\"attachment wp-att-986\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-986\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg24.png\" alt=\"reg24\" width=\"703\" height=\"531\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg24.png 703w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg24-300x227.png 300w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2016\/06\/reg24-260x196.png 260w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/a><\/p>\n<hr \/>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/regression\/regression-solution\/\">See the Hand-Written Work<\/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":282,"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-558","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/558","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=558"}],"version-history":[{"count":8,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/558\/revisions"}],"predecessor-version":[{"id":988,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/558\/revisions\/988"}],"up":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/282"}],"wp:attachment":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/media?parent=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}