* * Example from section 16.4.3, page 433 * open data cola.dat data(format=free,org=columns) 1 5466 id choice price feature display * * Define a variable which shows which drink this row describes. (%clock(n,m) is a * modulo operator that maps to 1,...,m rather than 0,...,m-1) * set drink = %clock(t,3) * * Define dummies for Pepsi and SevenUp. * set pepsi = drink==1 set sevenup = drink==2 * ddv(type=conditional,indiv=id,mode=drink) choice # price pepsi sevenup * * These are the three scenarios examined for predicting probabilities. The base * has the original settings of $1 for Pepsi, $1.25 for SevenUp and $1.10 for Coke. * You have to make sure that you set the correct values for the two dummy * variables. * dec rect base(3,3) input base 1.00 1 0 1.25 0 1 1.10 0 0 * * Same as base except for the price on Pepsi (the (1,1) element). * dec rect case1(3,3) input case1 1.10 1 0 1.25 0 1 1.10 0 0 * * Same as base except for the price on Coke (the (3,1) element). * dec rect case2(3,3) input case2 1.00 1 0 1.25 0 1 1.15 0 0 * @PRJConditional(title="Base Probabilities",attrib=base,labels=||"Pepsi","SevenUp","Coke"||) @PRJConditional(title="With Higher Pepsi",attrib=case1,labels=||"Pepsi","SevenUp","Coke"||) @PRJConditional(title="With Higher Coke",attrib=case2,labels=||"Pepsi","SevenUp","Coke"||)