<?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 Re: How to select all variables from a table except 1 to run regression analysis in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/751807#M29713</link>
    <description>Although u said that is a very bad idea, it helped me too much. Tks!</description>
    <pubDate>Fri, 02 Jul 2021 18:59:47 GMT</pubDate>
    <dc:creator>massaaki</dc:creator>
    <dc:date>2021-07-02T18:59:47Z</dc:date>
    <item>
      <title>How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519496#M3814</link>
      <description>&lt;P&gt;Hi as mentioned in the subject, how can I select all the variable from a table to run the regression. I can't manually type 100s of variables. Is there a way to get all the variable except 1 I am using as a depended variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If&amp;nbsp; I were to manually type it would look like this... how can I automatically select all the variables from a table except 1 or few?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data= testdata;&lt;BR /&gt;model depvar = test1 test2 apple1 ball .... cat;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shone&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 17:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519496#M3814</guid>
      <dc:creator>Shone</dc:creator>
      <dc:date>2018-12-07T17:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519499#M3817</link>
      <description>&lt;P&gt;Hi! So yes, you can select all the other variables in a data set for use in regression or logistic regression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But before I get to that, I consider this a VERY BAD idea, because these hundreds of x-variables will be correlated with one another and so you will be badly overfitting the model; and the coefficients of the regression will have HUGE variances.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But ... here's how you select all the variables except the Y variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=testdata noprint out=_contents_;
run;

proc sql noprint;
    select name into :names separated by ' ' from _contents_ where upcase(name)^='DEPVAR';
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From there, instead you could use the macro variable just created, &amp;amp;names, as the right hand side of the model statement. But don't do that. Go ahead and read up on variable selection methods, and use those; or use your subject matter judgement (or your client's subject matter judgment) to pick at most 10 variables that are likely to be the most predictive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best solution, IMHO, is not programmed in SAS unfortunately (but is programmed in R) is to perform Logistic Partial Least Squares regression, in which case you can use all of the variables. Here is a reference:&amp;nbsp;&lt;A href="https://cedric.cnam.fr/fichiers/RC906.pdf" target="_blank"&gt;https://cedric.cnam.fr/fichiers/RC906.pdf&lt;/A&gt;.&amp;nbsp;For continuous Y-variables, use PROC PLS in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519499#M3817</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-07T18:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519500#M3818</link>
      <description>Depends, here are some different ways you can create the list: &lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+TheDoLoop+%28The+DO+Loop" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+TheDoLoop+%28The+DO+Loop&lt;/A&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519500#M3818</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-07T18:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519501#M3819</link>
      <description>&lt;P&gt;Did you try it almost like you have it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data= testdata;
     model depvar = test1--cat;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519501#M3819</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2018-12-07T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519503#M3820</link>
      <description>&lt;P&gt;Thank you so much. I agree we might not want to take all the variables but this dataset contains all the variable needed for analysis.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519503#M3820</guid>
      <dc:creator>Shone</dc:creator>
      <dc:date>2018-12-07T18:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519505#M3821</link>
      <description>&lt;P&gt;Can you please let me know how do I account that depvar could be in the middle of the dataset. Please note that depvar is also in the dataset. If I used the test1- cat it will take depvar as well&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519505#M3821</guid>
      <dc:creator>Shone</dc:creator>
      <dc:date>2018-12-07T18:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519513#M3822</link>
      <description>&lt;P&gt;Similar approach, but using SASHELP tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select name into :var_list separated by " " from sashelp.vcolumn where upcase(libname)='SASHELP' and upcase(memname)='CARS'
and upcase(name) ne ('INVOICE');;
quit;

%put &amp;amp;var_list;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/519513#M3822</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-07T18:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to select all variables from a table except 1 to run regression analysis</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/751807#M29713</link>
      <description>Although u said that is a very bad idea, it helped me too much. Tks!</description>
      <pubDate>Fri, 02 Jul 2021 18:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-select-all-variables-from-a-table-except-1-to-run/m-p/751807#M29713</guid>
      <dc:creator>massaaki</dc:creator>
      <dc:date>2021-07-02T18:59:47Z</dc:date>
    </item>
  </channel>
</rss>

