<?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 How to loop a series of variables in logistic regression automatically? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627607#M30182</link>
    <description>&lt;P&gt;Assuming there is existence of multicollinearity effect of an importance variable(X1) in a logistic regression model, I would like to find out how the performance of model will change if these correlated variables are removed one by one. Because I found X1 has opposite sign in the final model compared to bivariate&amp;nbsp; model(). I would like to find the variable(s) causing the sign flipped. Here are the details,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Run proc corr and sort the correlation coefficients with X1 from high to low&lt;/LI&gt;&lt;LI&gt;Loop over a set of variables in a logistic regression by reducing the one variable each time&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;1) with X1&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Variable&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Coefficient&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;x2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.6&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;x3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;x4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;Proc logistic data= data desc;&lt;/P&gt;&lt;P&gt;Model y= x1 x4 x3 x2;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc logistic data=data desc ;&lt;/P&gt;&lt;P&gt;Model y=x1 x4 x3;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc logistic data=data desc ;&lt;/P&gt;&lt;P&gt;Model y= x1 x4;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to convert logistic regression process in an automatic way? Thanks a lot.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 21:20:41 GMT</pubDate>
    <dc:creator>lionking19063</dc:creator>
    <dc:date>2020-02-26T21:20:41Z</dc:date>
    <item>
      <title>How to loop a series of variables in logistic regression automatically?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627607#M30182</link>
      <description>&lt;P&gt;Assuming there is existence of multicollinearity effect of an importance variable(X1) in a logistic regression model, I would like to find out how the performance of model will change if these correlated variables are removed one by one. Because I found X1 has opposite sign in the final model compared to bivariate&amp;nbsp; model(). I would like to find the variable(s) causing the sign flipped. Here are the details,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Run proc corr and sort the correlation coefficients with X1 from high to low&lt;/LI&gt;&lt;LI&gt;Loop over a set of variables in a logistic regression by reducing the one variable each time&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;1) with X1&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Variable&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Coefficient&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;x2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.6&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;x3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;x4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;Proc logistic data= data desc;&lt;/P&gt;&lt;P&gt;Model y= x1 x4 x3 x2;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc logistic data=data desc ;&lt;/P&gt;&lt;P&gt;Model y=x1 x4 x3;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc logistic data=data desc ;&lt;/P&gt;&lt;P&gt;Model y= x1 x4;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to convert logistic regression process in an automatic way? Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 21:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627607#M30182</guid>
      <dc:creator>lionking19063</dc:creator>
      <dc:date>2020-02-26T21:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop a series of variables in logistic regression automatically?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627661#M30186</link>
      <description>&lt;P&gt;See &lt;A href="http://support.sas.com/kb/46847" target="_self"&gt;this note&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 20:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627661#M30186</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2020-02-26T20:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop a series of variables in logistic regression automatically?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627664#M30187</link>
      <description>&lt;P&gt;So you wouldn't ever look at a model that is just X4 as a predictor?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model X1=X4;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PROC LOGISTIC does give you the ability to perform "&lt;SPAN&gt;best subset selection" which may be a slightly better method than your looping, and certainly is less coding. You could use the option METHOD=SCORE in the model statement to get this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 20:54:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627664#M30187</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-26T20:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop a series of variables in logistic regression automatically?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627746#M30191</link>
      <description>&lt;P&gt;Calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 04:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-loop-a-series-of-variables-in-logistic-regression/m-p/627746#M30191</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-02-27T04:03:49Z</dc:date>
    </item>
  </channel>
</rss>

