<?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: calculate all possible  combinations to calculate PD in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956950#M4247</link>
    <description>&lt;P&gt;If you want to find ALL the solution, try the following code.&lt;/P&gt;
&lt;P&gt;I found 36 solutions for&amp;nbsp;pd=0.104 +/- 0.001;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input var $  value coefficient;
cards;
X1 1	 -0.1
X1 2	 0.25
X1 3 	0
X2 1	 0.35
X2 2	 0
X3 1	 0.75
X3 2	 0
X4 1	 0.95
X4 2	 1.45
X4 3 	0
X5 1	 -1.2
X5 2	 0
X6 1	 -1.1
X6 2	 2.2
X6 3	 0
X7 1	 -0.7
X7 2	 0.8
X7 3	 1.6
X7 4 	0
X8 1	 -1.1
X8 2  0
X9 1	 0.6
X9 2	 0.9
X9 3 	0
INTER 1 -2.5
;
Run;


proc optmodel;
set&amp;lt;str,num&amp;gt; idx ;
set row=setof{&amp;lt;i,j&amp;gt; in idx} i; 
set col=setof{&amp;lt;i,j&amp;gt; in idx} j; 

num x{idx};
var v{idx} binary;

read data have into  idx=[var value] x=coefficient ;
impvar sum_coeff = sum{&amp;lt;i,j&amp;gt; in idx} v[i,j]*x[i,j];
con sum: -2.164326874&amp;lt;=sum_coeff&amp;lt;=-2.142863368 ;  
/*sum_coeff=log(pd/(1-pd)  ==&amp;gt;  0.103 -&amp;gt; -2.164326874     0.105 -&amp;gt; -2.142863368 )*/
con var{i in row}:sum{j in col:&amp;lt;i,j&amp;gt; in idx} v[i,j]=1;
/*solve with clp;*/
/*create data want from [var value]={&amp;lt;i,j&amp;gt; in idx: v[i,j]&amp;gt;0.5} coefficient=x[i,j] ;*/

solve with clp/findallsolns;
create data want from [combination var value]={s in 1.._NSOL_,&amp;lt;i,j&amp;gt; in idx: v[i,j].sol[s]&amp;gt;0.5} coefficient=x[i,j] ;
quit;
/*
proc print;run;
proc sql;
select exp(sum(coefficient))/(1+exp(sum(coefficient))) as pd from want;
quit;
*/

proc sort data=want;
by combination var value;
run;
proc sql;
create table want2 as
select combination,exp(sum(coefficient))/(1+exp(sum(coefficient))) as pd from want group by combination;
quit;


/*
data _null_;
pd=0.104-0.001;
a=log(pd/(1-pd));
put pd= a=;
pd=0.104+0.001;
a=log(pd/(1-pd));
put pd= a=;
run;
*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737596955496.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103914i6D45ADFFE089D4BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737596955496.png" alt="Ksharp_0-1737596955496.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2025 01:49:21 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-01-23T01:49:21Z</dc:date>
    <item>
      <title>calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956731#M4240</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Let's say someone sent me the regression formula to calculate PD .&lt;/P&gt;
&lt;P&gt;I want to check which combination can create&amp;nbsp; PD&amp;nbsp;&amp;nbsp; 0.104&lt;/P&gt;
&lt;P&gt;So I need to run the all possible combinations and then check which of them get OD 0.104 ( can be 0.01 higher or lower than it )&lt;/P&gt;
&lt;P&gt;Please note:&lt;/P&gt;
&lt;P&gt;PD is calculated by :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;a=sum of coefficents&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PD=Exp(a) / 1+Exp(a)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The answer to my question is that the following combination provide PD 0.104.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;My question- How to provide the answer via sas code ?&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1737452487413.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103872iA4D243949C51485C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1737452487413.png" alt="Ronein_0-1737452487413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input var $  value coefficient;
cards;
X1 1	 -0.1
X1 2	 0.25
X1 3 	0
X2 1	 0.35
X2 2	 0
X3 1	 0.75
X3 2	 0
X4 1	 0.95
X4 2	 1.45
X4 3 	0
X5 1	 -1.2
X5 2	 0
X6 1	 -1.1
X6 2	 2.2
X6 3	 0
X7 1	 -0.7
X7 2	 0.8
X7 3	 1.6
X7 4 	0
X8 1	 -1.1
X8 2  0
X9 1	 0.6
X9 2	 0.9
X9 3 	0
INTER 1 -2.5
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 09:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956731#M4240</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-21T09:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956833#M4241</link>
      <description>&lt;P&gt;Did you have SAS/OR ? For a large scale problem you have to use PROC OPTMODEL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input var $  value coefficient;
length flag $ 80;
flag=catx(' ',var,value);
cards;
X1 1	 -0.1
X1 2	 0.25
X1 3 	0
X2 1	 0.35
X2 2	 0
X3 1	 0.75
X3 2	 0
X4 1	 0.95
X4 2	 1.45
X4 3 	0
X5 1	 -1.2
X5 2	 0
X6 1	 -1.1
X6 2	 2.2
X6 3	 0
X7 1	 -0.7
X7 2	 0.8
X7 3	 1.6
X7 4 	0
X8 1	 -1.1
X8 2  0
X9 1	 0.6
X9 2	 0.9
X9 3 	0
INTER 1 -2.5
;
Run;


proc optmodel;
set&amp;lt;str&amp;gt; idx ;
num x{idx};
var v{idx} binary;

read data have into  idx=[flag] x=coefficient ;
impvar sum_coeff = sum{i in idx} v[i]*x[i];
con con1: -2.265744524&amp;lt;=sum_coeff&amp;lt;=-2.050518502   ;  
/*sum_coeff=log(pd/(1-pd)  ==&amp;gt;  0.094-&amp;gt;-2.265744524    0.114-&amp;gt;-2.050518502 )*/
solve with clp;
/*solve with clp/findallsolns;*/
create data want from [combination id]={s in 1.._NSOL_,i in idx:v[i].sol&amp;gt;0.5} Column1=x[i] flag=v[i].sol[s];
quit;

proc print;
run;
proc sql;
select exp(sum(Column1))/(1+exp(sum(Column1))) as pd from want;
quit;

/*
data _null_;
pd=0.094;
a=log(pd/(1-pd));
put pd= a=;
pd=0.114;
a=log(pd/(1-pd));
put pd= a=;
run;
*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737515518983.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103888i6A139D73797C5B19/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737515518983.png" alt="Ksharp_0-1737515518983.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 03:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956833#M4241</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-22T03:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956839#M4242</link>
      <description>&lt;P&gt;While I have solved similar problems, I have never seen a variable called VALUE.&amp;nbsp; What does it mean?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 04:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956839#M4242</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2025-01-22T04:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956854#M4243</link>
      <description>&lt;P&gt;I think here VAR represents the name of the scoring variable, and VALUE the value of said scoring variable for a customer. In this way of presenting it, it's just a key-value pair construct.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 07:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956854#M4243</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-01-22T07:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956900#M4244</link>
      <description>&lt;P&gt;In the output get&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1737570464217.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103894i5B7E100D8B78C22C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1737570464217.png" alt="Ronein_0-1737570464217.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does it mean?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why there is no information about variables X1,X2,X3,X4,X5,X6 (and have only information about X7,X8,X9)?&lt;/P&gt;
&lt;P&gt;I wanted to see all possible combinations with calcultion of PD for each of them and the binary indicatorif PD equal to the required PD&amp;nbsp; in my quaestion.&lt;/P&gt;
&lt;P&gt;It is possible that multiple combinations provide same PD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 18:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956900#M4244</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-22T18:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956948#M4246</link>
      <description>&lt;P&gt;So you want to pick up one obs from each X1 - X9 ?&lt;/P&gt;
&lt;P&gt;a.k.a&lt;/P&gt;
&lt;P&gt;one obs from X1&lt;/P&gt;
&lt;P&gt;one obs from X2&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;one obs from X9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code you could get ONE solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input var $  value coefficient;
cards;
X1 1	 -0.1
X1 2	 0.25
X1 3 	0
X2 1	 0.35
X2 2	 0
X3 1	 0.75
X3 2	 0
X4 1	 0.95
X4 2	 1.45
X4 3 	0
X5 1	 -1.2
X5 2	 0
X6 1	 -1.1
X6 2	 2.2
X6 3	 0
X7 1	 -0.7
X7 2	 0.8
X7 3	 1.6
X7 4 	0
X8 1	 -1.1
X8 2  0
X9 1	 0.6
X9 2	 0.9
X9 3 	0
INTER 1 -2.5
;
Run;


proc optmodel;
set&amp;lt;str,num&amp;gt; idx ;
set row=setof{&amp;lt;i,j&amp;gt; in idx} i; 
set col=setof{&amp;lt;i,j&amp;gt; in idx} j; 

num x{idx};
var v{idx} binary;

read data have into  idx=[var value] x=coefficient ;
impvar sum_coeff = sum{&amp;lt;i,j&amp;gt; in idx} v[i,j]*x[i,j];
con sum: -2.164326874&amp;lt;=sum_coeff&amp;lt;=-2.142863368 ;  
/*sum_coeff=log(pd/(1-pd)  ==&amp;gt;  0.103 -&amp;gt; -2.164326874     0.105 -&amp;gt; -2.142863368 )*/
con var{i in row}:sum{j in col:&amp;lt;i,j&amp;gt; in idx} v[i,j]=1;
solve with clp;

create data want from [var value]={&amp;lt;i,j&amp;gt; in idx: v[i,j]&amp;gt;0.5} coefficient=x[i,j] ;

quit;

proc print;run;
proc sql;
select exp(sum(coefficient))/(1+exp(sum(coefficient))) as pd from want;
quit;

/*
data _null_;
pd=0.104-0.001;
a=log(pd/(1-pd));
put pd= a=;
pd=0.104+0.001;
a=log(pd/(1-pd));
put pd= a=;
run;
*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737595999046.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103913i0C01403DAFE50586/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737595999046.png" alt="Ksharp_0-1737595999046.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 01:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956948#M4246</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-23T01:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956950#M4247</link>
      <description>&lt;P&gt;If you want to find ALL the solution, try the following code.&lt;/P&gt;
&lt;P&gt;I found 36 solutions for&amp;nbsp;pd=0.104 +/- 0.001;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input var $  value coefficient;
cards;
X1 1	 -0.1
X1 2	 0.25
X1 3 	0
X2 1	 0.35
X2 2	 0
X3 1	 0.75
X3 2	 0
X4 1	 0.95
X4 2	 1.45
X4 3 	0
X5 1	 -1.2
X5 2	 0
X6 1	 -1.1
X6 2	 2.2
X6 3	 0
X7 1	 -0.7
X7 2	 0.8
X7 3	 1.6
X7 4 	0
X8 1	 -1.1
X8 2  0
X9 1	 0.6
X9 2	 0.9
X9 3 	0
INTER 1 -2.5
;
Run;


proc optmodel;
set&amp;lt;str,num&amp;gt; idx ;
set row=setof{&amp;lt;i,j&amp;gt; in idx} i; 
set col=setof{&amp;lt;i,j&amp;gt; in idx} j; 

num x{idx};
var v{idx} binary;

read data have into  idx=[var value] x=coefficient ;
impvar sum_coeff = sum{&amp;lt;i,j&amp;gt; in idx} v[i,j]*x[i,j];
con sum: -2.164326874&amp;lt;=sum_coeff&amp;lt;=-2.142863368 ;  
/*sum_coeff=log(pd/(1-pd)  ==&amp;gt;  0.103 -&amp;gt; -2.164326874     0.105 -&amp;gt; -2.142863368 )*/
con var{i in row}:sum{j in col:&amp;lt;i,j&amp;gt; in idx} v[i,j]=1;
/*solve with clp;*/
/*create data want from [var value]={&amp;lt;i,j&amp;gt; in idx: v[i,j]&amp;gt;0.5} coefficient=x[i,j] ;*/

solve with clp/findallsolns;
create data want from [combination var value]={s in 1.._NSOL_,&amp;lt;i,j&amp;gt; in idx: v[i,j].sol[s]&amp;gt;0.5} coefficient=x[i,j] ;
quit;
/*
proc print;run;
proc sql;
select exp(sum(coefficient))/(1+exp(sum(coefficient))) as pd from want;
quit;
*/

proc sort data=want;
by combination var value;
run;
proc sql;
create table want2 as
select combination,exp(sum(coefficient))/(1+exp(sum(coefficient))) as pd from want group by combination;
quit;


/*
data _null_;
pd=0.104-0.001;
a=log(pd/(1-pd));
put pd= a=;
pd=0.104+0.001;
a=log(pd/(1-pd));
put pd= a=;
run;
*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737596955496.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103914i6D45ADFFE089D4BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737596955496.png" alt="Ksharp_0-1737596955496.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 01:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956950#M4247</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-23T01:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956952#M4248</link>
      <description>&lt;P&gt;Here is solution I found the same as yours.&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="Ksharp_0-1737597599770.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103915iC34B7CB7F41EDF36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737597599770.png" alt="Ksharp_0-1737597599770.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 02:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956952#M4248</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-23T02:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: calculate all possible  combinations to calculate PD</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956957#M4249</link>
      <description>&lt;P&gt;Since your obs is so small, you could&amp;nbsp; brute force to enumerate all the solutions.&lt;/P&gt;
&lt;P&gt;Still get 36 solutions for pd=0.104 +/- 0.001 .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input var $  value coefficient;
cards;
X1 1	 -0.1
X1 2	 0.25
X1 3 	0
X2 1	 0.35
X2 2	 0
X3 1	 0.75
X3 2	 0
X4 1	 0.95
X4 2	 1.45
X4 3 	0
X5 1	 -1.2
X5 2	 0
X6 1	 -1.1
X6 2	 2.2
X6 3	 0
X7 1	 -0.7
X7 2	 0.8
X7 3	 1.6
X7 4 	0
X8 1	 -1.1
X8 2  0
X9 1	 0.6
X9 2	 0.9
X9 3 	0
INTER 1 -2.5
;
Run;
proc sql;
create table want as
select * from
(select value as x1_value,coefficient as x1_coefficient from have where var='X1'),
(select value as x2_value,coefficient as x2_coefficient from have where var='X2'),
(select value as x3_value,coefficient as x3_coefficient from have where var='X3'),
(select value as x4_value,coefficient as x4_coefficient from have where var='X4'),
(select value as x5_value,coefficient as x5_coefficient from have where var='X5'),
(select value as x6_value,coefficient as x6_coefficient from have where var='X6'),
(select value as x7_value,coefficient as x7_coefficient from have where var='X7'),
(select value as x8_value,coefficient as x8_coefficient from have where var='X8'),
(select value as x9_value,coefficient as x9_coefficient from have where var='X9'),
(select value as inter_value,coefficient as inter_coefficient from have where var='INTER')
where
-2.164326874&amp;lt;=
sum(
x1_coefficient,
x2_coefficient,
x3_coefficient,
x4_coefficient,
x5_coefficient,
x6_coefficient,
x7_coefficient,
x8_coefficient,
x9_coefficient,
inter_coefficient
)
&amp;lt;=-2.142863368 ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jan 2025 08:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/calculate-all-possible-combinations-to-calculate-PD/m-p/956957#M4249</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-23T08:41:35Z</dc:date>
    </item>
  </channel>
</rss>

