# Subset Selection Regression

There are many different ways in which the variables of a regression model can be selected. In this post, we look at several common ways in which to select variables or features for a regression model. In particular, we look at the following.

• Best subset regression
• Stepwise selection

Best Subset Regression

Best subset regression fits a regression model for every possible combination of variables. The “best” model can be selected based on such criteria as the adjusted r-square, BIC (Bayesian Information Criteria), etc.

The primary drawback to best subset regression is that it becomes impossible to compute the results when you have a large number of variables. Generally, when the number of variables exceeds 40 best subset regression becomes too difficult to calculate.

Stepwise Selection

Stepwise selection involves adding or taking away one variable at a time from a regression model. There are two forms of stepwise selection and they are forward and backward selection.

In forward selection, the computer starts with a null model ( a model that calculates the mean) and adds one variable at a time to the model. The variable chosen is the one the provides the best improvement to the model fit. This process reduces greatly the number of models that need to be fitted in comparison to best subset regression.

Backward selection starts the full model and removes one variable at a time based on which variable improves the model fit the most. The main problem with either forward or backward selection is that the best model may not always be selected in this process. In addition, backward selection must have a sample size that is larger than the number of variables.

Deciding Which to Choose

Best subset regression is perhaps most appropriate when you have a small number of variables to develop a model with, such as less than 40. When the number of variables grows forward or backward selection are appropriate. If the sample size is small forward selection may be a better choice. However, if the sample size is large as in the number of examples is greater than the number of variables it is now possible to use backward selection.

Conclusion

The examples here are some of the most basic ways to develop a regression model. However, these are not the only ways in which this can be done. What these examples provide is an introduction to regression model development. In addition, these models provide some sort of criteria for the addition or removal of a variable based on statistics rather than intuition.
{"ft_lang_label":"__label__en","ft_lang_prob":0.92846876,"math_prob":0.9736504,"size":2529,"snap":"2021-43-2021-49","text_gpt3_token_len":480,"char_repetition_ratio":0.1770297,"word_repetition_ratio":0.007125891,"special_character_ratio":0.18623962,"punctuation_ratio":0.07439825,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9950996,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,1,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-11-30T00:48:13Z\",\"WARC-Record-ID\":\"<urn:uuid:e3c1c2d4-ad7c-4183-bde9-807c3230bbcc>\",\"Content-Length\":\"86926\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ade29993-3dbc-431b-8338-fec40a1c73a6>\",\"WARC-Concurrent-To\":\"<urn:uuid:a64986fd-b0db-4cc8-8d06-bba596a68359>\",\"WARC-IP-Address\":\"192.0.78.163\",\"WARC-Target-URI\":\"https://educationalresearchtechniques.com/2017/12/01/subset-selection-regression/?shared=email&msg=fail\",\"WARC-Payload-Digest\":\"sha1:7MJY5Y7HRFCOGJFZPBUCV5K6GHQ4JLSV\",\"WARC-Block-Digest\":\"sha1:DTTHKKHT5QVLID5KOYSHLT3Y3NMS4NOK\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964358847.80_warc_CC-MAIN-20211129225145-20211130015145-00431.warc.gz\"}"}