{"id":142,"date":"2022-06-13T19:51:13","date_gmt":"2022-06-13T19:51:13","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/chapter\/model-selection\/"},"modified":"2022-06-13T19:51:13","modified_gmt":"2022-06-13T19:51:13","slug":"model-selection","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/chapter\/model-selection\/","title":{"raw":"Model Selection","rendered":"Model Selection"},"content":{"raw":"\n<div>\n\nThe best model is not always the most complicated. Sometimes including variables that&nbsp;are not evidently important can actually reduce the accuracy of predictions. In this section we discuss model selection strategies, which will help us eliminate variables from the model&nbsp;that are found to be less important.\n\nIn practice, the model that includes all available explanatory variables is often referred&nbsp;to as the<strong> full model<\/strong>. The full model may not be the best model, and if it isn't, we want&nbsp;to identify a smaller model that is preferable.\n<h2>Identifying variables in the model that may not be helpful<\/h2>\nAdjusted<em> <em>R<\/em><sup>2<\/sup><\/em>&nbsp;describes the strength of a model fit, and it is a useful tool for evaluating&nbsp;which predictors are adding value to the model, where<em> adding value<\/em> means they are (likely)&nbsp;improving the accuracy in predicting future outcomes.\n\nLet's consider two models, which are shown in Tables 1&nbsp;and 2. The first table&nbsp;summarizes the full model since it includes all predictors, while the second does not include&nbsp;the duration variable.\n\n<\/div>\n<em>df<\/em> = 136\n<table>\n<thead>\n<tr>\n<th colspan=\"5\">Table 1.&nbsp;The fit for the full regression model, including the adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><\/td>\n<td>Estimate<\/td>\n<td>Std. Error<\/td>\n<td>t value<\/td>\n<td>Pr(<em> &gt;<\/em>|t|)<\/td>\n<\/tr>\n<tr>\n<td>(Intercept)<\/td>\n<td>36.2110<\/td>\n<td>1.5140<\/td>\n<td>23.92<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>cond_new<\/td>\n<td>5.1306<\/td>\n<td>1.0511<\/td>\n<td>4.88<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>stock_photo<\/td>\n<td>1.0803<\/td>\n<td>1.0568<\/td>\n<td>1.02<\/td>\n<td>0.3085<\/td>\n<\/tr>\n<tr>\n<td>duration<\/td>\n<td>\u20130.0268<\/td>\n<td>0.1904<\/td>\n<td>\u20130.14<\/td>\n<td>0.8882<\/td>\n<\/tr>\n<tr>\n<td>wheels<\/td>\n<td>7.2852<\/td>\n<td>0.5547<\/td>\n<td>13.13<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td><em><em><em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub><\/em><\/em>&nbsp;= 0<em>.<\/em>7108<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><\/div>\n<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>df<\/em> = 137\n<table>\n<thead>\n<tr>\n<th colspan=\"5\">Table 2. The fit for the regression model for predictors cond_new,&nbsp;stock_photo, and wheels.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><\/td>\n<td>Estimate<\/td>\n<td>Std. Error<\/td>\n<td>t value<\/td>\n<td>Pr(<em> &gt;<\/em>|t|)<\/td>\n<\/tr>\n<tr>\n<td>(Intercept)<\/td>\n<td>36.0483<\/td>\n<td>0.9745<\/td>\n<td>36.99<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>cond_new<\/td>\n<td>5.1763<\/td>\n<td>0.9961<\/td>\n<td>5.20<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>stock_photo<\/td>\n<td>1.1177<\/td>\n<td>1.0192<\/td>\n<td>1.10<\/td>\n<td>0.2747<\/td>\n<\/tr>\n<tr>\n<td>wheels<\/td>\n<td>7.2984<\/td>\n<td>0.5448<\/td>\n<td>13.40<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td><em><em><em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub><\/em><\/em>&nbsp;= 0<em>.<\/em>7128<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n&nbsp;\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\nWhich of the two models is better?\n\nSolution:\n\nWe compare the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;of each model to determine which to choose. Since the&nbsp;first model has an<em> R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;smaller than the<em> R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;of the second model, we prefer the&nbsp;second model to the first.\n\nWill the model without duration be better than the model with duration? We cannot&nbsp;know for sure, but based on the adjusted<em> R<sup>2<\/sup><\/em>, this is our best assessment.\n\n<\/div>\n<h2>Two model selection strategies<\/h2>\nTwo common strategies for adding or removing variables in a multiple regression model are&nbsp;called<em> backward elimination<\/em> and<em> forward selection<\/em>. These techniques are often referred to as<strong> stepwise<\/strong> model selection strategies, because they add or delete one variable at a time&nbsp;as they \"step\" through the candidate predictors.\n\n<strong>Backward elimination<\/strong> starts with the model that includes all potential predictor&nbsp;variables. Variables are eliminated one-at-a-time from the model until we cannot improve the adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>. The strategy within each elimination step is to eliminate the variable that&nbsp;leads to the largest improvement in adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>.\n<p style=\"text-align: center;\"><\/p>\n\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\nResults corresponding to the<em> full model<\/em> for the mario kart data are shown in Table 8.6. How should we proceed under the backward elimination&nbsp;strategy?\n\nSolution:\n\nOur baseline adjusted<em> R<sup>2<\/sup><\/em>&nbsp;from the full model is&nbsp;<em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub> = 0<em>.<\/em>7108, and we need to&nbsp;determine whether dropping a predictor will improve the adjusted<em> R<sup>2<\/sup><\/em>. To check, we\n\nfit four models that each drop a different predictor, and we record the adjusted<em> R<sup>2<\/sup><\/em>\n\nfrom each:\n\n[latex]\\begin{array}\\text{Exclude . . .}\\hfill&amp;\\text{cond_new}\\hfill&amp;\\text{stock_photo}\\hfill&amp;\\text{duration}\\hfill&amp;\\text{wheels}\\\\\\text{ }\\hfill&amp;R^2_{adj}=0.6626\\hfill&amp;R^2_{adj}=0.7107\\hfill&amp;R^2_{adj}=0.7128\\hfill&amp;R^2_{adj}=0.3487\\end{array}[\/latex]\n\nThe third model without duration has the highest adjusted<em> R<sup>2<\/sup><\/em>&nbsp;of 0.7128, so we&nbsp;compare it to the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;for the full model. Because eliminating duration&nbsp;leads to a model with a higher adjusted<em> R<sup>2<\/sup><\/em>, we drop duration from the model.&nbsp;Since we eliminated a predictor from the model in the first step, we see whether&nbsp;we should eliminate any additional predictors. Our baseline adjusted<em> R<sup>2<\/sup><\/em>&nbsp;is now&nbsp;<em>R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;= 0<em>.<\/em>7128. We now fit three new models, which consider eliminating each of the&nbsp;three remaining predictors:\n\n[latex]\\begin{array}\\text{Exclude duration and . . .}\\hfill&amp;\\text{cond_new}\\hfill&amp;\\text{stock_photo}\\hfill&amp;\\text{wheels}\\\\\\text{ }\\hfill&amp;R^2_{adj}=0.6587\\hfill&amp;R^2_{adj}=0.7124\\hfill&amp;R^2_{adj}=0.3414\\end{array}[\/latex]\n\nNone of these models lead to an improvement in adjusted<em> R<sup>2<\/sup><\/em>, so we do not eliminate&nbsp;any of the remaining predictors. That is, after backward elimination, we are left with the model that keeps cond new, stock photos, and wheels, which we can summarize&nbsp;using the coefficients from Table 2:\n\n[latex]\\displaystyle\\hat{y}=b_0+b_1x_1+b_2x_2+b_4x_4[\/latex]\n\n[latex]\\displaystyle\\widehat{\\text{price}}=36.05+5.18\\times\\text{cond_new}+1.12\\times\\text{stock_photo}+7.30\\times\\text{wheels}[\/latex]\n\n<\/div>\nThe<strong> forward selection<\/strong> strategy is the reverse of the backward elimination technique.&nbsp;Instead of eliminating variables one-at-a-time, we add variables one-at-a-time until we&nbsp;cannot find any variables that improve the model (as measured by adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>).\n\n&nbsp;\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\nConstruct a model for the mario kart data set using the forward&nbsp;selection strategy.\n\nSolution:\n\nWe start with the model that includes no variables. Then we fit each of the possible&nbsp;models with just one variable. That is, we fit the model including just cond_new, then the model including just stock photo, then a model with just duration, and a&nbsp;model with just wheels. Each of the four models provides an adjusted<em> R<sup>2<\/sup><\/em>&nbsp;value:\n\n[latex]\\begin{array}\\text{Add . . .}\\hfill&amp;\\text{cond_new}\\hfill&amp;\\text{stock_photo}\\hfill&amp;\\text{duration}\\hfill&amp;\\text{wheels}\\\\\\text{ }\\hfill&amp;R^2_{adj}=0.3459\\hfill&amp;R^2_{adj}=0.0332\\hfill&amp;R^2_{adj}=0.1338\\hfill&amp;R^2_{adj}=0.6390\\end{array}[\/latex]\n\nIn this first step, we compare the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;against a baseline model that has&nbsp;no predictors. The no-predictors model always has&nbsp;<em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub>&nbsp;= 0. The model with one&nbsp;predictor that has the largest adjusted<em> R<sup>2<\/sup><\/em>&nbsp;is the model with the wheels predictor,&nbsp;and because this adjusted<em> R<sup>2<\/sup><\/em>&nbsp;is larger than the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;from the model with no&nbsp;predictors (<em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub>&nbsp;= 0), we will add this variable to our model.\n\nWe repeat the process again, this time considering 2-predictor models where one of&nbsp;the predictors is wheels and with a new baseline of<em> R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;= 0<em>.<\/em>6390:\n\n[latex]\\begin{array}\\text{Add wheels and . . .}\\hfill&amp;\\text{cond_new}\\hfill&amp;\\text{stock_photo}\\hfill&amp;\\text{duration}\\\\\\text{ }\\hfill&amp;R^2_{adj}=0.7124\\hfill&amp;R^2_{adj}=0.6587\\hfill&amp;R^2_{adj}=0.6528\\end{array}[\/latex]\n\nThe best predictor in this stage, cond new, has a higher adjusted<em> R<sup>2<\/sup><\/em>&nbsp;(0.7124) than&nbsp;the baseline (0.6390), so we also add cond_new to the model.\n\nSince we have again added a variable to the model, we continue and see whether it&nbsp;would be beneficial to add a third variable:\n\n[latex]\\begin{array}\\text{Add wheels, cond_new, and . . .}\\hfill&amp;\\text{stock_photo}\\hfill&amp;\\text{duration}\\\\\\text{ }\\hfill&amp;R^2_{adj}=0.7128\\hfill&amp;R^2_{adj}=0.7107\\end{array}[\/latex]\n\nThe model adding stock photo improved adjusted<em> R<sup>2<\/sup><\/em>&nbsp;(0.7124 to 0.7128), so we add&nbsp;stock_photo to the model.\n\nBecause we have again added a predictor, we check whether adding the last variable,&nbsp;duration, will improve adjusted<em> R<sup>2<\/sup><\/em>. We compare the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;for the model with duration and the other three predictors (0.7108) to the model that only considers wheels, cond_new, and stock photo (0.7128). Adding duration does not improve the adjusted<em> R<sup>2<\/sup><\/em>, so we do not add it to the model, and we have arrived at the same&nbsp;model that we identified from backward elimination.\n\n<\/div>\n<div class=\"textbox\">\n<h3>Model Selection Strategies<\/h3>\nBackward elimination begins with the largest model and eliminates variables one-by-one until we are satisfied that all remaining variables are important to the model. Forward selection starts with no variables included in the model, then it adds in variables according to their importance until no other important variables&nbsp;are found.\n\n<\/div>\nThere is no guarantee that backward elimination and forward selection will arrive at&nbsp;the same final model. If both techniques are tried and they arrive at different models, we&nbsp;choose the model with the larger<em> <em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub><\/em>; other tie-break options exist but are beyond the&nbsp;scope of this book.\n<h2>The <em>p<\/em>-Value Approach, an Alternative to Adjusted <em>R<\/em><sup>2<\/sup><\/h2>\nThe <em>p<\/em>-value may be used as an alternative to adjusted <em>R<\/em><sup>2<\/sup>&nbsp;for model selection.\n\nIn backward elimination, we would identify the predictor corresponding to the largest&nbsp;<em>p<\/em>-value. If the <em>p<\/em>-value is above the significance level, usually <em>\u03b1<\/em> = 0<em>.<\/em>05, then we would drop that variable, refit the model, and repeat the process. If the largest <em>p<\/em>-value is less than <em>\u03b1<\/em> = 0<em>.<\/em>05, then we would not eliminate any predictors and the current model would be our&nbsp;best-fitting model.\n\nIn forward selection with <em>p<\/em>-values, we reverse the process. We begin with a model&nbsp;that has no predictors, then we fit a model for each possible predictor, identifying the model where the corresponding predictor's <em>p<\/em>-value is smallest. If that <em>p<\/em>-value is smaller than&nbsp;<em>\u03b1<\/em>&nbsp;= 0<em>.<\/em>05, we add it to the model and repeat the process, considering whether to add more variables one-at-a-time. When none of the remaining predictors can be added to the model and have a <em>p<\/em>-value less than 0.05, then we stop adding variables and the current&nbsp;model would be our best-fitting model.\n\n&nbsp;\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\nExamine Table 2, which considers the model including the cond_new, stock_photo, and wheels predictors. If we were using the <em>p<\/em>-value approach with backward elimination and we were considering this model, which of these three variables would be up for elimination? Would we drop that variable,&nbsp;or would we keep it in the model?\n\nSolution:\n\nThe stock photo predictor is up for elimination since it has the largest <em>p<\/em>-value. Additionally, since that <em>p<\/em>-value is larger than 0.05, we would in fact eliminate stock photo from the model.\n\n<\/div>\nWhile the adjusted<em> <em><em>R<\/em><sup>2<\/sup><\/em><\/em>&nbsp;and <em>p<\/em>-value approaches are similar, they sometimes lead to&nbsp;different models, with the adjusted<em> <em><em>R<\/em><sup>2<\/sup><\/em><\/em>&nbsp;approach tending to include more predictors in the final model. For example, if we had used the <em>p<\/em>-value approach with the auction data, we&nbsp;would not have included the stock photo predictor in the final model.\n<div class=\"textbox\">\n<h3>When to use the adjusted <em>R<\/em><sup>2<\/sup>&nbsp;and when to use the <em>p<\/em>-value approach<\/h3>\nWhen the sole goal is to improve prediction accuracy, use adjusted <em>R<\/em><sup>2<\/sup>. This is&nbsp;commonly the case in machine learning applications.\n\nWhen we care about understanding which variables are statistically significant predictors of the response, or if there is interest in producing a simpler model at the potential cost of a little prediction accuracy, then the <em>p<\/em>-value approach is preferred.\n\n<\/div>\nRegardless of whether you use adjusted <em>R<\/em><sup>2<\/sup>&nbsp;or the <em>p<\/em>-value approach, or if you use&nbsp;the backward elimination of forward selection strategy, our job is not done after variable&nbsp;selection. We must still verify the model conditions are reasonable.\n","rendered":"<div>\n<p>The best model is not always the most complicated. Sometimes including variables that&nbsp;are not evidently important can actually reduce the accuracy of predictions. In this section we discuss model selection strategies, which will help us eliminate variables from the model&nbsp;that are found to be less important.<\/p>\n<p>In practice, the model that includes all available explanatory variables is often referred&nbsp;to as the<strong> full model<\/strong>. The full model may not be the best model, and if it isn&#8217;t, we want&nbsp;to identify a smaller model that is preferable.<\/p>\n<h2>Identifying variables in the model that may not be helpful<\/h2>\n<p>Adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>&nbsp;describes the strength of a model fit, and it is a useful tool for evaluating&nbsp;which predictors are adding value to the model, where<em> adding value<\/em> means they are (likely)&nbsp;improving the accuracy in predicting future outcomes.<\/p>\n<p>Let&#8217;s consider two models, which are shown in Tables 1&nbsp;and 2. The first table&nbsp;summarizes the full model since it includes all predictors, while the second does not include&nbsp;the duration variable.<\/p>\n<\/div>\n<p><em>df<\/em> = 136<\/p>\n<table>\n<thead>\n<tr>\n<th colspan=\"5\">Table 1.&nbsp;The fit for the full regression model, including the adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><\/td>\n<td>Estimate<\/td>\n<td>Std. Error<\/td>\n<td>t value<\/td>\n<td>Pr(<em> &gt;<\/em>|t|)<\/td>\n<\/tr>\n<tr>\n<td>(Intercept)<\/td>\n<td>36.2110<\/td>\n<td>1.5140<\/td>\n<td>23.92<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>cond_new<\/td>\n<td>5.1306<\/td>\n<td>1.0511<\/td>\n<td>4.88<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>stock_photo<\/td>\n<td>1.0803<\/td>\n<td>1.0568<\/td>\n<td>1.02<\/td>\n<td>0.3085<\/td>\n<\/tr>\n<tr>\n<td>duration<\/td>\n<td>\u20130.0268<\/td>\n<td>0.1904<\/td>\n<td>\u20130.14<\/td>\n<td>0.8882<\/td>\n<\/tr>\n<tr>\n<td>wheels<\/td>\n<td>7.2852<\/td>\n<td>0.5547<\/td>\n<td>13.13<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td><em><em><em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub><\/em><\/em>&nbsp;= 0<em>.<\/em>7108<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><\/div>\n<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>df<\/em> = 137<\/p>\n<table>\n<thead>\n<tr>\n<th colspan=\"5\">Table 2. The fit for the regression model for predictors cond_new,&nbsp;stock_photo, and wheels.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><\/td>\n<td>Estimate<\/td>\n<td>Std. Error<\/td>\n<td>t value<\/td>\n<td>Pr(<em> &gt;<\/em>|t|)<\/td>\n<\/tr>\n<tr>\n<td>(Intercept)<\/td>\n<td>36.0483<\/td>\n<td>0.9745<\/td>\n<td>36.99<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>cond_new<\/td>\n<td>5.1763<\/td>\n<td>0.9961<\/td>\n<td>5.20<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td>stock_photo<\/td>\n<td>1.1177<\/td>\n<td>1.0192<\/td>\n<td>1.10<\/td>\n<td>0.2747<\/td>\n<\/tr>\n<tr>\n<td>wheels<\/td>\n<td>7.2984<\/td>\n<td>0.5448<\/td>\n<td>13.40<\/td>\n<td>0.0000<\/td>\n<\/tr>\n<tr>\n<td><em><em><em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub><\/em><\/em>&nbsp;= 0<em>.<\/em>7128<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Which of the two models is better?<\/p>\n<p>Solution:<\/p>\n<p>We compare the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;of each model to determine which to choose. Since the&nbsp;first model has an<em> R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;smaller than the<em> R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;of the second model, we prefer the&nbsp;second model to the first.<\/p>\n<p>Will the model without duration be better than the model with duration? We cannot&nbsp;know for sure, but based on the adjusted<em> R<sup>2<\/sup><\/em>, this is our best assessment.<\/p>\n<\/div>\n<h2>Two model selection strategies<\/h2>\n<p>Two common strategies for adding or removing variables in a multiple regression model are&nbsp;called<em> backward elimination<\/em> and<em> forward selection<\/em>. These techniques are often referred to as<strong> stepwise<\/strong> model selection strategies, because they add or delete one variable at a time&nbsp;as they &#8220;step&#8221; through the candidate predictors.<\/p>\n<p><strong>Backward elimination<\/strong> starts with the model that includes all potential predictor&nbsp;variables. Variables are eliminated one-at-a-time from the model until we cannot improve the adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>. The strategy within each elimination step is to eliminate the variable that&nbsp;leads to the largest improvement in adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>.<\/p>\n<p style=\"text-align: center;\">\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Results corresponding to the<em> full model<\/em> for the mario kart data are shown in Table 8.6. How should we proceed under the backward elimination&nbsp;strategy?<\/p>\n<p>Solution:<\/p>\n<p>Our baseline adjusted<em> R<sup>2<\/sup><\/em>&nbsp;from the full model is&nbsp;<em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub> = 0<em>.<\/em>7108, and we need to&nbsp;determine whether dropping a predictor will improve the adjusted<em> R<sup>2<\/sup><\/em>. To check, we<\/p>\n<p>fit four models that each drop a different predictor, and we record the adjusted<em> R<sup>2<\/sup><\/em><\/p>\n<p>from each:<\/p>\n<p>[latex]\\begin{array}\\text{Exclude . . .}\\hfill&\\text{cond_new}\\hfill&\\text{stock_photo}\\hfill&\\text{duration}\\hfill&\\text{wheels}\\\\\\text{ }\\hfill&R^2_{adj}=0.6626\\hfill&R^2_{adj}=0.7107\\hfill&R^2_{adj}=0.7128\\hfill&R^2_{adj}=0.3487\\end{array}[\/latex]<\/p>\n<p>The third model without duration has the highest adjusted<em> R<sup>2<\/sup><\/em>&nbsp;of 0.7128, so we&nbsp;compare it to the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;for the full model. Because eliminating duration&nbsp;leads to a model with a higher adjusted<em> R<sup>2<\/sup><\/em>, we drop duration from the model.&nbsp;Since we eliminated a predictor from the model in the first step, we see whether&nbsp;we should eliminate any additional predictors. Our baseline adjusted<em> R<sup>2<\/sup><\/em>&nbsp;is now&nbsp;<em>R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;= 0<em>.<\/em>7128. We now fit three new models, which consider eliminating each of the&nbsp;three remaining predictors:<\/p>\n<p>[latex]\\begin{array}\\text{Exclude duration and . . .}\\hfill&\\text{cond_new}\\hfill&\\text{stock_photo}\\hfill&\\text{wheels}\\\\\\text{ }\\hfill&R^2_{adj}=0.6587\\hfill&R^2_{adj}=0.7124\\hfill&R^2_{adj}=0.3414\\end{array}[\/latex]<\/p>\n<p>None of these models lead to an improvement in adjusted<em> R<sup>2<\/sup><\/em>, so we do not eliminate&nbsp;any of the remaining predictors. That is, after backward elimination, we are left with the model that keeps cond new, stock photos, and wheels, which we can summarize&nbsp;using the coefficients from Table 2:<\/p>\n<p>[latex]\\displaystyle\\hat{y}=b_0+b_1x_1+b_2x_2+b_4x_4[\/latex]<\/p>\n<p>[latex]\\displaystyle\\widehat{\\text{price}}=36.05+5.18\\times\\text{cond_new}+1.12\\times\\text{stock_photo}+7.30\\times\\text{wheels}[\/latex]<\/p>\n<\/div>\n<p>The<strong> forward selection<\/strong> strategy is the reverse of the backward elimination technique.&nbsp;Instead of eliminating variables one-at-a-time, we add variables one-at-a-time until we&nbsp;cannot find any variables that improve the model (as measured by adjusted<em> <em>R<\/em><sup>2<\/sup><\/em>).<\/p>\n<p>&nbsp;<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Construct a model for the mario kart data set using the forward&nbsp;selection strategy.<\/p>\n<p>Solution:<\/p>\n<p>We start with the model that includes no variables. Then we fit each of the possible&nbsp;models with just one variable. That is, we fit the model including just cond_new, then the model including just stock photo, then a model with just duration, and a&nbsp;model with just wheels. Each of the four models provides an adjusted<em> R<sup>2<\/sup><\/em>&nbsp;value:<\/p>\n<p>[latex]\\begin{array}\\text{Add . . .}\\hfill&\\text{cond_new}\\hfill&\\text{stock_photo}\\hfill&\\text{duration}\\hfill&\\text{wheels}\\\\\\text{ }\\hfill&R^2_{adj}=0.3459\\hfill&R^2_{adj}=0.0332\\hfill&R^2_{adj}=0.1338\\hfill&R^2_{adj}=0.6390\\end{array}[\/latex]<\/p>\n<p>In this first step, we compare the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;against a baseline model that has&nbsp;no predictors. The no-predictors model always has&nbsp;<em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub>&nbsp;= 0. The model with one&nbsp;predictor that has the largest adjusted<em> R<sup>2<\/sup><\/em>&nbsp;is the model with the wheels predictor,&nbsp;and because this adjusted<em> R<sup>2<\/sup><\/em>&nbsp;is larger than the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;from the model with no&nbsp;predictors (<em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub>&nbsp;= 0), we will add this variable to our model.<\/p>\n<p>We repeat the process again, this time considering 2-predictor models where one of&nbsp;the predictors is wheels and with a new baseline of<em> R<sup>2<\/sup><sub>adj<\/sub><\/em>&nbsp;= 0<em>.<\/em>6390:<\/p>\n<p>[latex]\\begin{array}\\text{Add wheels and . . .}\\hfill&\\text{cond_new}\\hfill&\\text{stock_photo}\\hfill&\\text{duration}\\\\\\text{ }\\hfill&R^2_{adj}=0.7124\\hfill&R^2_{adj}=0.6587\\hfill&R^2_{adj}=0.6528\\end{array}[\/latex]<\/p>\n<p>The best predictor in this stage, cond new, has a higher adjusted<em> R<sup>2<\/sup><\/em>&nbsp;(0.7124) than&nbsp;the baseline (0.6390), so we also add cond_new to the model.<\/p>\n<p>Since we have again added a variable to the model, we continue and see whether it&nbsp;would be beneficial to add a third variable:<\/p>\n<p>[latex]\\begin{array}\\text{Add wheels, cond_new, and . . .}\\hfill&\\text{stock_photo}\\hfill&\\text{duration}\\\\\\text{ }\\hfill&R^2_{adj}=0.7128\\hfill&R^2_{adj}=0.7107\\end{array}[\/latex]<\/p>\n<p>The model adding stock photo improved adjusted<em> R<sup>2<\/sup><\/em>&nbsp;(0.7124 to 0.7128), so we add&nbsp;stock_photo to the model.<\/p>\n<p>Because we have again added a predictor, we check whether adding the last variable,&nbsp;duration, will improve adjusted<em> R<sup>2<\/sup><\/em>. We compare the adjusted<em> R<sup>2<\/sup><\/em>&nbsp;for the model with duration and the other three predictors (0.7108) to the model that only considers wheels, cond_new, and stock photo (0.7128). Adding duration does not improve the adjusted<em> R<sup>2<\/sup><\/em>, so we do not add it to the model, and we have arrived at the same&nbsp;model that we identified from backward elimination.<\/p>\n<\/div>\n<div class=\"textbox\">\n<h3>Model Selection Strategies<\/h3>\n<p>Backward elimination begins with the largest model and eliminates variables one-by-one until we are satisfied that all remaining variables are important to the model. Forward selection starts with no variables included in the model, then it adds in variables according to their importance until no other important variables&nbsp;are found.<\/p>\n<\/div>\n<p>There is no guarantee that backward elimination and forward selection will arrive at&nbsp;the same final model. If both techniques are tried and they arrive at different models, we&nbsp;choose the model with the larger<em> <em>R<\/em><sup>2<\/sup><sub><em>adj<\/em><\/sub><\/em>; other tie-break options exist but are beyond the&nbsp;scope of this book.<\/p>\n<h2>The <em>p<\/em>-Value Approach, an Alternative to Adjusted <em>R<\/em><sup>2<\/sup><\/h2>\n<p>The <em>p<\/em>-value may be used as an alternative to adjusted <em>R<\/em><sup>2<\/sup>&nbsp;for model selection.<\/p>\n<p>In backward elimination, we would identify the predictor corresponding to the largest&nbsp;<em>p<\/em>-value. If the <em>p<\/em>-value is above the significance level, usually <em>\u03b1<\/em> = 0<em>.<\/em>05, then we would drop that variable, refit the model, and repeat the process. If the largest <em>p<\/em>-value is less than <em>\u03b1<\/em> = 0<em>.<\/em>05, then we would not eliminate any predictors and the current model would be our&nbsp;best-fitting model.<\/p>\n<p>In forward selection with <em>p<\/em>-values, we reverse the process. We begin with a model&nbsp;that has no predictors, then we fit a model for each possible predictor, identifying the model where the corresponding predictor&#8217;s <em>p<\/em>-value is smallest. If that <em>p<\/em>-value is smaller than&nbsp;<em>\u03b1<\/em>&nbsp;= 0<em>.<\/em>05, we add it to the model and repeat the process, considering whether to add more variables one-at-a-time. When none of the remaining predictors can be added to the model and have a <em>p<\/em>-value less than 0.05, then we stop adding variables and the current&nbsp;model would be our best-fitting model.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p>Examine Table 2, which considers the model including the cond_new, stock_photo, and wheels predictors. If we were using the <em>p<\/em>-value approach with backward elimination and we were considering this model, which of these three variables would be up for elimination? Would we drop that variable,&nbsp;or would we keep it in the model?<\/p>\n<p>Solution:<\/p>\n<p>The stock photo predictor is up for elimination since it has the largest <em>p<\/em>-value. Additionally, since that <em>p<\/em>-value is larger than 0.05, we would in fact eliminate stock photo from the model.<\/p>\n<\/div>\n<p>While the adjusted<em> <em><em>R<\/em><sup>2<\/sup><\/em><\/em>&nbsp;and <em>p<\/em>-value approaches are similar, they sometimes lead to&nbsp;different models, with the adjusted<em> <em><em>R<\/em><sup>2<\/sup><\/em><\/em>&nbsp;approach tending to include more predictors in the final model. For example, if we had used the <em>p<\/em>-value approach with the auction data, we&nbsp;would not have included the stock photo predictor in the final model.<\/p>\n<div class=\"textbox\">\n<h3>When to use the adjusted <em>R<\/em><sup>2<\/sup>&nbsp;and when to use the <em>p<\/em>-value approach<\/h3>\n<p>When the sole goal is to improve prediction accuracy, use adjusted <em>R<\/em><sup>2<\/sup>. This is&nbsp;commonly the case in machine learning applications.<\/p>\n<p>When we care about understanding which variables are statistically significant predictors of the response, or if there is interest in producing a simpler model at the potential cost of a little prediction accuracy, then the <em>p<\/em>-value approach is preferred.<\/p>\n<\/div>\n<p>Regardless of whether you use adjusted <em>R<\/em><sup>2<\/sup>&nbsp;or the <em>p<\/em>-value approach, or if you use&nbsp;the backward elimination of forward selection strategy, our job is not done after variable&nbsp;selection. We must still verify the model conditions are reasonable.<\/p>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-142\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>OpenIntro Statistics. <strong>Authored by<\/strong>: David M Diez, Christopher D Barr, and Mine Cetinkaya-Rundel. <strong>Provided by<\/strong>: OpenIntro. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/www.openintro.org\/stat\/textbook.php\">https:\/\/www.openintro.org\/stat\/textbook.php<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">CC BY-SA: Attribution-ShareAlike<\/a><\/em>. <strong>License Terms<\/strong>: This textbook is available under a Creative Commons license. Visit openintro.org for a free  PDF, to download the textbook&#039;s source files.<\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":395986,"menu_order":2,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"OpenIntro Statistics\",\"author\":\"David M Diez, Christopher D Barr, and Mine Cetinkaya-Rundel\",\"organization\":\"OpenIntro\",\"url\":\"https:\/\/www.openintro.org\/stat\/textbook.php\",\"project\":\"\",\"license\":\"cc-by-sa\",\"license_terms\":\"This textbook is available under a Creative Commons license. Visit openintro.org for a free  PDF, to download the textbook's source files.\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-142","chapter","type-chapter","status-publish","hentry"],"part":140,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/pressbooks\/v2\/chapters\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/wp\/v2\/users\/395986"}],"version-history":[{"count":0,"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/pressbooks\/v2\/chapters\/142\/revisions"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/pressbooks\/v2\/parts\/140"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/pressbooks\/v2\/chapters\/142\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/pressbooks\/v2\/chapter-type?post=142"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/wp\/v2\/contributor?post=142"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/nhti-introstats\/wp-json\/wp\/v2\/license?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}