See if you like this better. The additional restrictions are as follows:
_sum = (x1 >= x5) + (x2 >= x6) + (x3 >= x7);
if _sum = 0 | _sum = 3 then bad = bad + 1;
_sum = (x1 <= x5) + (x2 <= x6) + (x3 <= x7);
if _sum = 0 | _sum = 3 then bad = bad + 1;
First, I count the number of times attributes 1-3 in alternative 1 dominate attributes 1-3 in alternative 2 using Boolean arithmetic. Then I increase the badness criterion if there are not 1 or 2 attributes in those first three for alternative 1. Then I do the same thing for alternative 2. I let price do whatever it wants because nothing is dominated in the rest of the design. If this is not precisely what you want, restrictions can be tweaked or augmented. Be aware though that every time you impose a restriction, it decreases the efficiency of the design, the ability to estimate all the parameters. I always recommend (and I should have thought to say this in my last answer, but I have been retired for 6 years) that you use the ChoicEff macro to check the final choice design efficiency. There are lots of examples of it in my choice design writings.
%mktruns(4 2 2 4 4 2 2 4) /* factor level list for all attrs and alts */
%macro res;
_sum = (x1 = x5) + (x2 = x6) + (x3 = x7) + (x4 = x8);
bad = 0;
if _sum >= 3 then bad = _sum;
_sum = (x1 >= x5) + (x2 >= x6) + (x3 >= x7);
if _sum = 0 | _sum = 3 then bad = bad + 1;
_sum = (x1 <= x5) + (x2 <= x6) + (x3 <= x7);
if _sum = 0 | _sum = 3 then bad = bad + 1;
%mend;
%mktex(4 2 2 4 4 2 2 4, /* factor level list for all attrs and alts */
restrictions=res,
n=64, /* number of choice sets */
seed=17) /* random number seed */
%mktblock(data=randomized, /* block randomized design */
nblocks=2, /* create 2 blocks of 32 choice sets */
out=blocked, /* output data set for blocked design */
seed=17) /* random number seed */
data key;
input
Brand $ Knd $ Omg $ Mrk $ Price $; datalines;
Alt1 x1 x2 x3 x4
Alt2 x5 x6 x7 x8
None . . . . .
;
%mktroll(design=blocked, /* make choice design from blocked */
/* linear arrangement from %mktblock */
key=key, /* use rules in KEY data set */
alt=brand, /* alternative name variable is Place */
out=work.food64, /* permanent data set for results */
keep=block) /* keep the blocking variable */
proc format;
value knd 1 = '%5' 2 = '%10' 3 = '%15' 4 = '%20' . = ' ';
value omg 1 = 'no' 2 = 'yes' . = ' ';
value mrk 1 = 'no' 2 = 'yes' . = ' ';
value price 1 = $30 2 = $40 3 = $50 4 = $60 . = ' ';
run;
data work.food64;
set work.food64;
format knd knd. omg omg. mrk mrk. price price.;
run;
proc print data=work.food64(obs=192);
by set; id set;
run;
... View more