I am trying to find the optimal two products out of three (A,B,C) that maximizes total market penetration (i.e. unduplicated reach) in a specific market. The data below is an abbreviated example with just four subjects (01, 02, 03, 04) and three products (A,B,C). The current program maximizes the penetration of each of the products separately (choosing A and B as the decision vars that maximize the obj. function). However I need to maximize the market penetration as a whole. A & B only provide a total market penetration of 75%, whereas A & C provide a total market penetration of 100%. I'm having difficulty converting my program from individual to total market penetration. Still being relatively new to OPTMODEL, any help you can provide is very much appreciated. data byPROD;
input Product $ ;
datalines;
A
B
C
;
run;
data byID;
input unID $ A B C;
datalines;
01 1 1 0
02 1 1 0
03 1 0 0
04 0 0 1
;
run;
proc optmodel;
set <str> ID, PRODUCTS;
num units {ID,PRODUCTS};
read data byPROD into PRODUCTS=[Product];
read data byID into ID=[unID] {p in PRODUCTS} <units[unID,p]=col(p)>;
num ProdSum{p in PRODUCTS}=sum{i in ID} units[i,p];
var Subset{PRODUCTS} >=0 binary;
max MktPenetration=sum{p in PRODUCTS} ProdSum[p]*Subset[p];
con OnlyTwo: sum{p in PRODUCTS} Subset[p]=2;
solve;
print Subset;
quit;
... View more