<?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 plot in logistic regression in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/how-to-plot-in-logistic-regression/m-p/5574#M100</link>
    <description>You have to compute LOG(Prob(A=event|O)/Prob(A=non-event|O)) to draw it against the values of O. This quantity is known as Weight of Evidence (WoE) or log-odds. It is this quantity that is modelled in a similar fashion as Y in a linear regression : the logistic model is WoE = Xb.&lt;BR /&gt;
&lt;BR /&gt;
Since those probabilities can be computed as means, you just have to type the right "event" value for A (I assume it is 1 in the following code).[pre]&lt;BR /&gt;
PROC SQL ;&lt;BR /&gt;
   CREATE TABLE work.graph AS&lt;BR /&gt;
       SELECT o,&lt;BR /&gt;
              LOG(MEAN(a=1)/MEAN(a NE 1)) AS woe,&lt;BR /&gt;
			  COUNT(*) AS size&lt;BR /&gt;
	   FROM X&lt;BR /&gt;
	   GROUP BY o&lt;BR /&gt;
	;&lt;BR /&gt;
QUIT ;&lt;BR /&gt;
PROC GPLOT DATA = work.graph ;&lt;BR /&gt;
	BUBBLE woe * o = size ;&lt;BR /&gt;
RUN ; QUIT ;[/pre]&lt;BR /&gt;
If this graph shows a U-shaped relationship between A and O, it will be a good reason to include O2 in the model.&lt;BR /&gt;
&lt;BR /&gt;
Regards.&lt;BR /&gt;
Olivier</description>
    <pubDate>Tue, 27 Nov 2007 19:06:49 GMT</pubDate>
    <dc:creator>Olivier</dc:creator>
    <dc:date>2007-11-27T19:06:49Z</dc:date>
    <item>
      <title>how to plot in logistic regression</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/how-to-plot-in-logistic-regression/m-p/5573#M99</link>
      <description>Say O2=O*O&lt;BR /&gt;
&lt;BR /&gt;
proc logit data = X descending;&lt;BR /&gt;
   model A = O O2 P Q;&lt;BR /&gt;
   output out = Y p=pred xbeta=logit;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I want to plot a graph that can show the relationship between the probablity of A and O is a 'U' shape. How can I do this? Thanks!</description>
      <pubDate>Sat, 17 Nov 2007 20:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/how-to-plot-in-logistic-regression/m-p/5573#M99</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-11-17T20:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to plot in logistic regression</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/how-to-plot-in-logistic-regression/m-p/5574#M100</link>
      <description>You have to compute LOG(Prob(A=event|O)/Prob(A=non-event|O)) to draw it against the values of O. This quantity is known as Weight of Evidence (WoE) or log-odds. It is this quantity that is modelled in a similar fashion as Y in a linear regression : the logistic model is WoE = Xb.&lt;BR /&gt;
&lt;BR /&gt;
Since those probabilities can be computed as means, you just have to type the right "event" value for A (I assume it is 1 in the following code).[pre]&lt;BR /&gt;
PROC SQL ;&lt;BR /&gt;
   CREATE TABLE work.graph AS&lt;BR /&gt;
       SELECT o,&lt;BR /&gt;
              LOG(MEAN(a=1)/MEAN(a NE 1)) AS woe,&lt;BR /&gt;
			  COUNT(*) AS size&lt;BR /&gt;
	   FROM X&lt;BR /&gt;
	   GROUP BY o&lt;BR /&gt;
	;&lt;BR /&gt;
QUIT ;&lt;BR /&gt;
PROC GPLOT DATA = work.graph ;&lt;BR /&gt;
	BUBBLE woe * o = size ;&lt;BR /&gt;
RUN ; QUIT ;[/pre]&lt;BR /&gt;
If this graph shows a U-shaped relationship between A and O, it will be a good reason to include O2 in the model.&lt;BR /&gt;
&lt;BR /&gt;
Regards.&lt;BR /&gt;
Olivier</description>
      <pubDate>Tue, 27 Nov 2007 19:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/how-to-plot-in-logistic-regression/m-p/5574#M100</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2007-11-27T19:06:49Z</dc:date>
    </item>
  </channel>
</rss>

