<?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: Transform a U-shape variable in Logistic Regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593357#M28979</link>
    <description>&lt;P&gt;A quadratic doesn't really capture the relatively flat line part of the curve at the right of the diagram. A cubic might, but I am squeamish about recommending cubics in general. Which is why I feel that maybe a spline is the best method here (or maybe it isn't, you can't really know until you try).&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 13:11:07 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-10-02T13:11:07Z</dc:date>
    <item>
      <title>Transform a U-shape variable in Logistic Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/592689#M28962</link>
      <description>&lt;P&gt;Hi.. I am using logistic regression to predict the probability of being a bad customer. I need to transform each independent variable to make sure it has a strong linear relationship with the log-odds of my target. One variable has a upper U-shape when I plot the variable value against the log-odds. How should I transform it so I won't over-predict the lower group and under-predict the upper group?]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using square, but it did not give me a better/linear-er line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 504px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32839i3C6919EA6CC99EAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 14:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/592689#M28962</guid>
      <dc:creator>newboy1218</dc:creator>
      <dc:date>2019-09-30T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a U-shape variable in Logistic Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/592764#M28963</link>
      <description>&lt;P&gt;Applying a monotonic transformation (such as the square, or square root) to this variable will not eliminate the hump.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Applying a non-monotonic transformation (for example, a third order polynomial) can eliminate the hump, but may be questionable on subject matter grounds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, you might try fitting a cubic equation (or third order polynomial), as it seems as if whatever curve fits well will do good job of predicting log(p/1-p).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also consider PROC TRANSREG, where you use in the MODEL statement LOGIT(p) = SPLINE(x). However, I will admit as to never having done this, and so I have no experience whatsoever with using PROC TRANSREG in this manner.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/592764#M28963</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-30T17:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a U-shape variable in Logistic Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593243#M28971</link>
      <description>&lt;P&gt;Out-of-the-box logistic regression assumes a linear relationship between X and logit(Y). I like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;'s suggestion of a polynomial; like him, I think the cubic might be a bit excessive, but a quadratic might work if you transformed X using sqrt or log. EDIT: by which I mean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;model y = x x2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where x2 is x*x, and x is centered and possibly transformed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are no assumptions about the distribution of X, so you can apply transformations that better match a linear model (remember that a polynomial model is a curvi-linear model). Plus a sqrt or log transformation will reduce the leverage of the larger X values, which is convenient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nice illustrative graph! Very useful. But I definitely would not turn X into two categorical groups, you lose too much information. When you think about reality, not everything increases or decreases monotonically--remember the three bears: some porridge is too cold, some is too hot, and some is just right. Some values are "optimal".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 02:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593243#M28971</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2019-10-02T02:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a U-shape variable in Logistic Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593357#M28979</link>
      <description>&lt;P&gt;A quadratic doesn't really capture the relatively flat line part of the curve at the right of the diagram. A cubic might, but I am squeamish about recommending cubics in general. Which is why I feel that maybe a spline is the best method here (or maybe it isn't, you can't really know until you try).&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 13:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593357#M28979</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-02T13:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a U-shape variable in Logistic Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593360#M28980</link>
      <description>&lt;P&gt;Thank you! Yeah maybe I will explore the function &lt;SPAN&gt;PROC TRANSREG, with MODEL statement LOGIT(p) = SPLINE(x).&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 13:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593360#M28980</guid>
      <dc:creator>newboy1218</dc:creator>
      <dc:date>2019-10-02T13:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Transform a U-shape variable in Logistic Regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593795#M28989</link>
      <description>&lt;P&gt;Are you trying to build a credit score card ?&lt;/P&gt;
&lt;P&gt;Bin the variable to make a linear relation with Y ？&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3099-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3099-2019.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 16:08:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Transform-a-U-shape-variable-in-Logistic-Regression/m-p/593795#M28989</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-10-03T16:08:12Z</dc:date>
    </item>
  </channel>
</rss>

