<?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: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860130#M10440</link>
    <description>“When we model risk scorecard, all the parameter coefficients are the same direction (all negative or positive) after variable woe.”&lt;BR /&gt;&lt;BR /&gt;That is NOT true or right. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; discussed this topic at one of his blogs.</description>
    <pubDate>Wed, 22 Feb 2023 11:47:41 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-02-22T11:47:41Z</dc:date>
    <item>
      <title>SAS fitting logistic regression, how to make all parameters coefficient are positive or negative？</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860089#M10439</link>
      <description>&lt;P&gt;SAS Like H2o, there is non_negative options in H2O (H2OGeneralizedLinearEstimator) can make it, or Glum (Python Package) can control coefficient with lower bound or upper bound. When we model risk scorecard, all the parameter coefficients are the same direction (all negative or positive) after variable woe.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 07:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860089#M10439</guid>
      <dc:creator>RiskViya</dc:creator>
      <dc:date>2023-02-22T07:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860130#M10440</link>
      <description>“When we model risk scorecard, all the parameter coefficients are the same direction (all negative or positive) after variable woe.”&lt;BR /&gt;&lt;BR /&gt;That is NOT true or right. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; discussed this topic at one of his blogs.</description>
      <pubDate>Wed, 22 Feb 2023 11:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860130#M10440</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-02-22T11:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860155#M10441</link>
      <description>&lt;P&gt;Adding to the comments from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's suppose you have at least these two variables in your scorecard model: FICO and number of delinquencies in last 24 months. These have opposite effects ... as FICO goes up, the score should go up; and number of delinquencies in last 24 months goes up, the score should go down. The coefficients in the model for these two variables SHOULD have opposite signs; there is nothing wrong with this. In fact, restricting the coefficients to have the same signs would make the model fit worse and cause the scores to do illogical things.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 13:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860155#M10441</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-22T13:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860195#M10442</link>
      <description>The variables are monotonically divided into bins and WOE encoded, which is consistent with the correlation of the target variable. Therefore, &amp;nbsp;The case you mentioned above is the original variable, and the scorecard was developed using the WOE-encoded variable.</description>
      <pubDate>Wed, 22 Feb 2023 15:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860195#M10442</guid>
      <dc:creator>RiskViya</dc:creator>
      <dc:date>2023-02-22T15:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860197#M10443</link>
      <description>&lt;P&gt;If the original variable is used for glm regression, the positive and negative reaction variables of the sign are related to the target variable, but after WOE coding, the correlation symbol should be consistent, and the review of the model by the strategy is also more acceptable to the model with the same parameter symbol.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 15:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860197#M10443</guid>
      <dc:creator>RiskViya</dc:creator>
      <dc:date>2023-02-22T15:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860320#M10444</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use the&amp;nbsp;HPGENSELECT Procedure and RESTRICT statement therein.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The RESTRICT statement enables you to specify linear equality or inequality constraints among the parameters of a model. These restrictions are incorporated into the maximum likelihood analysis.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You might expect all WOE-variables to have the same sign (based on bi-variate relationship between target and input) , but due to multi-collinearity ( f.e. ) in the full model one or two WOE-variables can still get a sign opposite to the one you might expect.&lt;BR /&gt;&lt;BR /&gt;See also here (although this is PROC REG) :&lt;BR /&gt;Restricted least squares regression in SAS &lt;BR /&gt;By Rick Wicklin on The DO Loop September 16, 2020&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/09/16/restricted-regression-sas.html" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2020/09/16/restricted-regression-sas.html&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 23:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860320#M10444</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-02-22T23:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860418#M10445</link>
      <description>1)"but after WOE coding, the correlation symbol should be consistent"&lt;BR /&gt;Why do you think that would happen? Either you use original variable&lt;BR /&gt;or WOE variable to build a model ,they are all under general LINEAR model.&lt;BR /&gt;Noticed that they both fit LINEAR effect not non-linear effect.&lt;BR /&gt;&lt;BR /&gt;2)"the review of the model by the strategy is also more acceptable to the model with the same parameter symbol."&lt;BR /&gt;Maybe you are right.But &lt;BR /&gt;That is for business thing(i.e. could get better explanation for scorecard,better fit business rule),&lt;BR /&gt;NOT for statistical thing/theory .&lt;BR /&gt;In statistical theory there is no need to constrain coefficient to be positive or negative.&lt;BR /&gt;&lt;BR /&gt;3)"The variables are monotonically divided into bins and WOE encoded, which is consistent with the correlation of the target variable."&lt;BR /&gt;They are the same thing,Both fit LINEAR effect as you said monotonically between X and Y.&lt;BR /&gt;And even worse, after you bin original variable into WOE,you lost more information than original variable,&lt;BR /&gt;That why &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; suggest to use original variable to build model not WOE.&lt;BR /&gt;But in Scorecard to use WOE could make a better explanation than original variable.&lt;BR /&gt;And that is not reason you think estimated coefficient all should be positive or negative.&lt;BR /&gt;And if you check the SAS documentation of Scorecard ,&lt;BR /&gt;there is also an example which include positive and negative both .&lt;BR /&gt;Base your opinion ,SAS documentation is WRONG ?&lt;BR /&gt;&lt;BR /&gt;P.S I totall agree with Paige's opinion.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;4)"The variables are monotonically divided into bins and WOE encoded, which is consistent with the correlation of the target variable."&lt;BR /&gt;But under other variables/WOE influence , the correlation could reverse(a.k.a positive become negative).</description>
      <pubDate>Thu, 23 Feb 2023 11:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860418#M10445</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-02-23T11:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860421#M10446</link>
      <description>&lt;P&gt;With respect, I have never made any public statements about building scorecards or using WOE. KSharp, when you want to encourage an OP to read something that I wrote, it would be good to provide a link so that the OP can read exactly what I said, including the context in which I said it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I encourage the OP to think about the comments from Paige and others who have pointed out that the parameters in a regression model should not be artificially constrained without a good reason. Doing so can reduce the accuracy of the model's predictions.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 12:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/860421#M10446</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-02-23T12:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/868585#M10473</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar query. As part of a scorecard development, I have transformed all explanatory variables using WOE and established a monotonic relationship (increasing or decreasing) of each variable with the response variable. Should all coefficients be negative when I apply a logistic regression to the transformed explanatory variables?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 12:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/868585#M10473</guid>
      <dc:creator>MikaellaK</dc:creator>
      <dc:date>2023-04-07T12:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/868586#M10474</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392928"&gt;@MikaellaK&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a similar query. As part of a scorecard development, I have transformed all explanatory variables using WOE and established a monotonic relationship (increasing or decreasing) of each variable with the response variable. Should all coefficients be negative when I apply a logistic regression to the transformed explanatory variables?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does not the above discussion answer this question?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 12:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/868586#M10474</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-07T12:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS fitting logistic regression, how to make all parameters coefficient are positive or negative</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/868591#M10475</link>
      <description>&lt;P&gt;No. Absolutely not .&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; wrote a wonderful blog "Simpson's Paradox" to explain this problem.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2023/03/27/simpsons-paradox.html" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2023/03/27/simpsons-paradox.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorKsharp_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1680870443895.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82413iE6F39529BDFCAEA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1680870443895.png" alt="Ksharp_1-1680870443895.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Suppose X stands for income per month, Y stands for the probability of default ,&lt;/P&gt;
&lt;P&gt;From all the data, you could see the linear decreasing relationship between X and Y.&lt;/P&gt;
&lt;P&gt;But if you take into account AGE variable, you would see the reverse result . Surprise ?&lt;/P&gt;
&lt;P&gt;So you can't constraint all the parameter to be positive or negative .&lt;/P&gt;
&lt;P&gt;And Rick also pointed out that would reduce the accuracy of model's prediction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 12:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-fitting-logistic-regression-how-to-make-all-parameters/m-p/868591#M10475</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-07T12:40:52Z</dc:date>
    </item>
  </channel>
</rss>

