<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/474964#M24713</link>
    <description>&lt;P&gt;Dear friends, SAS communities,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched for&amp;nbsp;this question but haven't got any answer. I realized that the best subset selection in SAS is unusually fast, and it is impossible to scan all the combinations in such a short time. When I use R to do best subset selection (use 'leaps' package), it took 3 hours (thus I trust it does scan all the 2^p combination, I have p = 50, which gives over a billion models). And SAS only used 1 second. Actually, the output from SAS is the same as the result of stepwise selection in R.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Remark: the comments by&amp;nbsp;&lt;EM&gt;FreelanceReinhard&amp;nbsp; &lt;/EM&gt;is right, I think R did not search all the combinations either... 2^50 gives over 10^15 combinations...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is, does SAS actually use stepwise for "best subset" selection when the number of features is above some certain number?&lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;PRE class="r"&gt;&lt;CODE class="hljs"&gt;&lt;SPAN class="hljs-comment"&gt;# SAS code for best subset selection:&lt;/SPAN&gt;
proc reg data = mydata4 plot = none;
model Share_Temporary = CC10_Household_Size  -- JJ1_Electricity_Availableyes /selection=cp best =&lt;SPAN class="hljs-number"&gt;5&lt;/SPAN&gt; vif stb;
run;
quit;

&lt;SPAN class="hljs-comment"&gt;# R code for stepwise selection, which gives &lt;U&gt;&lt;STRONG&gt;same results as the SAS code above&lt;/STRONG&gt;&lt;/U&gt;:&lt;/SPAN&gt;
fit_allvars &amp;lt;- lm(Share_Temporary ~ ., data = mydata4)
step &amp;lt;- stepAIC(fit_allvars, direction = &lt;SPAN class="hljs-string"&gt;"both"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover, if&amp;nbsp;I do stepwise in SAS, it will give a shorter list of variables, but all of them are contained in the selection result of best subset from SAS.&lt;/P&gt;&lt;PRE class="r"&gt;&lt;CODE class="hljs"&gt;/* SAS code &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; best subset selection*/
proc reg data = mydata plot = none;
model Share_Temporary = CC10_Household_Size  -- JJ1_Electricity_Availableyes /selection=cp best = &lt;SPAN class="hljs-number"&gt;3&lt;/SPAN&gt; stb;
run;
quit;

/* SAS code &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; stepwise selection*/
proc reg data = mydata plot = none;
model Share_Temporary = CC10_Household_Size  -- JJ1_Electricity_Availableyes /selection=stepwise;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;A comparison of SAS results using the code above: same variables are highlighted. All the variables that are in stepwise selection result are included in the "Best Subset" selection result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="comparison 2.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21541i409CB67A675AD2F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="comparison 2.JPG" alt="comparison 2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have discussed in more details in &lt;A href="https://yangliuresearch.blogspot.com/2018/06/sass-best-subset-by-cp-is-actually.html" target="_self"&gt;my blog&lt;/A&gt;, but this seems to be the case and I have no way to find further explanations on it.&lt;/P&gt;&lt;P&gt;If anyone could help to share some insights I will really appreciate. It has really puzzled me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time and advice,&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Yang&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. I have attached the dataset. There are 49 predictors starting at column C (A, B are ID, intercept). The dependent variable is the last column. The SAS code below can be applied directly (after changing the directory).&lt;/P&gt;&lt;P&gt;Dimension: 598 * 51&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile="D:\....... \mydata4.csv"&lt;BR /&gt;out= mydata dbms=csv replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*proc print data = mydata (obs = 10);*/&lt;BR /&gt;/*run;*/&lt;/P&gt;&lt;P&gt;proc corr data = mydata noprob;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* SAS code for best subset selection*/&lt;BR /&gt;proc reg data = mydata plot = none;&lt;BR /&gt;model Share_Temporary = CC10_Household_Size -- JJ1_Electricity_Availableyes /selection=cp best = 3 stb;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;/* SAS code for stepwise selection*/&lt;BR /&gt;proc reg data = mydata plot = none;&lt;BR /&gt;model Share_Temporary = CC10_Household_Size -- JJ1_Electricity_Availableyes /selection=stepwise;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jul 2018 00:02:30 GMT</pubDate>
    <dc:creator>liuyangnyu</dc:creator>
    <dc:date>2018-07-03T00:02:30Z</dc:date>
    <item>
      <title>I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/474964#M24713</link>
      <description>&lt;P&gt;Dear friends, SAS communities,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched for&amp;nbsp;this question but haven't got any answer. I realized that the best subset selection in SAS is unusually fast, and it is impossible to scan all the combinations in such a short time. When I use R to do best subset selection (use 'leaps' package), it took 3 hours (thus I trust it does scan all the 2^p combination, I have p = 50, which gives over a billion models). And SAS only used 1 second. Actually, the output from SAS is the same as the result of stepwise selection in R.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Remark: the comments by&amp;nbsp;&lt;EM&gt;FreelanceReinhard&amp;nbsp; &lt;/EM&gt;is right, I think R did not search all the combinations either... 2^50 gives over 10^15 combinations...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is, does SAS actually use stepwise for "best subset" selection when the number of features is above some certain number?&lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;PRE class="r"&gt;&lt;CODE class="hljs"&gt;&lt;SPAN class="hljs-comment"&gt;# SAS code for best subset selection:&lt;/SPAN&gt;
proc reg data = mydata4 plot = none;
model Share_Temporary = CC10_Household_Size  -- JJ1_Electricity_Availableyes /selection=cp best =&lt;SPAN class="hljs-number"&gt;5&lt;/SPAN&gt; vif stb;
run;
quit;

&lt;SPAN class="hljs-comment"&gt;# R code for stepwise selection, which gives &lt;U&gt;&lt;STRONG&gt;same results as the SAS code above&lt;/STRONG&gt;&lt;/U&gt;:&lt;/SPAN&gt;
fit_allvars &amp;lt;- lm(Share_Temporary ~ ., data = mydata4)
step &amp;lt;- stepAIC(fit_allvars, direction = &lt;SPAN class="hljs-string"&gt;"both"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover, if&amp;nbsp;I do stepwise in SAS, it will give a shorter list of variables, but all of them are contained in the selection result of best subset from SAS.&lt;/P&gt;&lt;PRE class="r"&gt;&lt;CODE class="hljs"&gt;/* SAS code &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; best subset selection*/
proc reg data = mydata plot = none;
model Share_Temporary = CC10_Household_Size  -- JJ1_Electricity_Availableyes /selection=cp best = &lt;SPAN class="hljs-number"&gt;3&lt;/SPAN&gt; stb;
run;
quit;

/* SAS code &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; stepwise selection*/
proc reg data = mydata plot = none;
model Share_Temporary = CC10_Household_Size  -- JJ1_Electricity_Availableyes /selection=stepwise;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;A comparison of SAS results using the code above: same variables are highlighted. All the variables that are in stepwise selection result are included in the "Best Subset" selection result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="comparison 2.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21541i409CB67A675AD2F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="comparison 2.JPG" alt="comparison 2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have discussed in more details in &lt;A href="https://yangliuresearch.blogspot.com/2018/06/sass-best-subset-by-cp-is-actually.html" target="_self"&gt;my blog&lt;/A&gt;, but this seems to be the case and I have no way to find further explanations on it.&lt;/P&gt;&lt;P&gt;If anyone could help to share some insights I will really appreciate. It has really puzzled me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time and advice,&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Yang&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. I have attached the dataset. There are 49 predictors starting at column C (A, B are ID, intercept). The dependent variable is the last column. The SAS code below can be applied directly (after changing the directory).&lt;/P&gt;&lt;P&gt;Dimension: 598 * 51&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile="D:\....... \mydata4.csv"&lt;BR /&gt;out= mydata dbms=csv replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*proc print data = mydata (obs = 10);*/&lt;BR /&gt;/*run;*/&lt;/P&gt;&lt;P&gt;proc corr data = mydata noprob;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* SAS code for best subset selection*/&lt;BR /&gt;proc reg data = mydata plot = none;&lt;BR /&gt;model Share_Temporary = CC10_Household_Size -- JJ1_Electricity_Availableyes /selection=cp best = 3 stb;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;/* SAS code for stepwise selection*/&lt;BR /&gt;proc reg data = mydata plot = none;&lt;BR /&gt;model Share_Temporary = CC10_Household_Size -- JJ1_Electricity_Availableyes /selection=stepwise;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 00:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/474964#M24713</guid>
      <dc:creator>liuyangnyu</dc:creator>
      <dc:date>2018-07-03T00:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475044#M24719</link>
      <description>&lt;P&gt;Can you upload your dat so we can replicate your results?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 20:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475044#M24719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-02T20:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475048#M24720</link>
      <description>&lt;P&gt;I'm thinking the Best Subset selection is this algorithm&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;R. R. Hocking &amp;amp; R. N. Leslie. "Selection of the Best Subset in Regression Analysis", Technometrics, Vol 9, 1967, pp 531-540&lt;/P&gt;
&lt;P&gt;&lt;A href="https://amstat.tandfonline.com/doi/abs/10.1080/00401706.1967.10490502#.WzqKrdVKhhE" target="_blank"&gt;https://amstat.tandfonline.com/doi/abs/10.1080/00401706.1967.10490502#.WzqKrdVKhhE&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 20:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475048#M24720</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-02T20:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475062#M24721</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218807"&gt;@liuyangnyu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I use R to do best subset selection (use 'leaps' package), it took 3 hours (thus I trust it does scan all the 2^p combination, I have p = 50, which gives over a billion models).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just a remark: 2^50&amp;gt;1.1*10^15. Three hours are 10800 seconds.&amp;nbsp;&lt;SPAN&gt;1.1*10^15/10800&amp;gt;10^11. Do you still trust your computer is able to scan &amp;gt;100 billion regression models &lt;EM&gt;per second&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 22:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475062#M24721</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-07-02T22:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475072#M24722</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;I have attached the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 49 predictors starting at column C (A, B are ID, intercept). The dependent variable is the last column ('&lt;SPAN&gt;Share_Temporary&lt;/SPAN&gt;'). The SAS code below can be applied directly (after changing the directory).&lt;/P&gt;&lt;P&gt;Dimension: 598 * 51&lt;/P&gt;&lt;P&gt;The dataset is based on a survey in African slum, trying to predict the share of the temporary structures by other variables. The dataset has been processed so there are lots of dummy variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 00:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475072#M24722</guid>
      <dc:creator>liuyangnyu</dc:creator>
      <dc:date>2018-07-03T00:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475073#M24723</link>
      <description>&lt;P&gt;Thank you, Miller, for your advice! I have no question with the algorithm, I simply think neither SAS or R actually scan all the possible combinations. I appreciate your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 00:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475073#M24723</guid>
      <dc:creator>liuyangnyu</dc:creator>
      <dc:date>2018-07-03T00:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475074#M24724</link>
      <description>&lt;P&gt;Dear friend,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You made a great point. Obviously, R did not scan all of them either. It might be a mission impossible (but the results from R is still different from best-subset). But what puzzles me is when there are fewer features, would SAS really scan all the parameters or not...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be precise, since I set the program to search&amp;nbsp;&lt;SPAN&gt;from 49 predictors but set the maximum size of subsets to be 25, there are C(49,25) + C(49,24) + ...+ C(49,0) = 3.447e+14&amp;nbsp; models to check. That is still too many to be true.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yang&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 00:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475074#M24724</guid>
      <dc:creator>liuyangnyu</dc:creator>
      <dc:date>2018-07-03T00:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475083#M24726</link>
      <description>&lt;P&gt;I am not a statistical-algorithm expert, but I know that there are clever "shortcuts" to some algorithmic tasks, possibly this one. I&amp;nbsp;would ask SAS Technical Support. They are there for you, use them (one huge advantage over R packages).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 02:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475083#M24726</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-07-03T02:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: I think SAS’s Best Subset selection in proc reg is actually Stepwise, am I right?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475282#M24746</link>
      <description>&lt;P&gt;I asked SAS support and got a great reply in a day from Kathleen. The&amp;nbsp;answer is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With selection-RSQUARE, ADJRSQ, and CP and n=number of regressors &amp;gt;=11, by default REG will only DISPLAY the best n subset models for each number of regressors. The &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;best n one variable models, best n two&amp;nbsp;&amp;nbsp;variable models, etc. These can be computed (using the Furnival and Wilson algorithm) without examining every possible model of every possible size and so this is typically much faster than if all models of each size need to be displayed. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By default, when you run PROC REG with the SELECTION=CP and the STOP=10 option, and you have 20 regressors in the model, PROC REG will display at most 20 models for each of the 1-variable models, 2-variable models, 3-variable models, ...through 10-variable models.&amp;nbsp;&amp;nbsp;In other words, the maximum number of models displayed will be equal to the number of predictor variables in the MODEL statement (if the number of predictors listed in the MODEL statement is greater than 11).&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To obtain more models than the number displayed by default, you will need to add the BEST= option to the MODEL statement.&amp;nbsp;&amp;nbsp;For example, if you have 20 predictors in your MODEL statement, but you want to see up to 35 models in each of the possible subsets, then your PROC REG step would need to look something like: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------- &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc reg data=test; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;model y = x1-x20 / selection=rsquare stop=10 best=35; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;quit; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;---------------------- &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope the above information is helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kathleen Kiernan&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Senior Principal Technical Support Statistician&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 18:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/I-think-SAS-s-Best-Subset-selection-in-proc-reg-is-actually/m-p/475282#M24746</guid>
      <dc:creator>liuyangnyu</dc:creator>
      <dc:date>2018-07-03T18:04:00Z</dc:date>
    </item>
  </channel>
</rss>

