1) You can include constraints, but you should always avoid creating perfectly correlated variables, so you should not use if(opt1.A=1, opt1.cost=20000) but rather if(opt1.A=1, opt1.cost=[20000,30000,40000]) or something similar.
2) Using the default swapping algorithm, you can only use conditional constraints with ;cond: if(...). I tried them in the script below, but if you run it Ngene will say that it cannot find a design because there are too many cases of dominance.
- Code: Select all
Design
;alts = opt1*, opt2*, opt3*, optout
;rows = 180
;block = 30
;eff = (mnl, d)
;cond:
if(opt1.A=1, opt1.cost=[20000,30000,40000]),
if(opt1.A=2, opt1.cost=[40000,50000,60000]),
if(opt1.A=3, opt1.cost=[60000,70000,80000]),
if(opt2.A=1, opt2.cost=[20000,30000,40000]),
if(opt2.A=2, opt2.cost=[40000,50000,60000]),
if(opt2.A=3, opt2.cost=[60000,70000,80000]),
if(opt3.A=1, opt3.cost=[20000,30000,40000]),
if(opt3.A=2, opt3.cost=[40000,50000,60000]),
if(opt3.A=3, opt3.cost=[60000,70000,80000])
;model:
U(opt1) = b1[0.000001]*A[1,2,3] + b2[0.000001]*B[1,2,3] + b3*C[20,40,60,80] + b4[-0.000001]*cost[20000:80000:10000] + b5[0.000001]*E[500:800:100] + b6[0.000001]*F[2,4,6,8] /
U(opt2) = b1*A+ b2*B+ b3*C+ b4*cost+ b5*E+ b6*F/
U(opt3) = b1*A+ b2*B+ b3*C+ b4*cost+ b5*E+ b6*F/
U(optout) = b7[0]
$
So next, you would need to switch to the modified Federov algorithm, see script below, and use reject constraints.
- Code: Select all
Design
;alts = opt1*, opt2*, opt3*, optout
;rows = 180
;block = 30
;eff = (mnl, d)
;alg = mfederov
;reject:
opt1.A=1 and opt1.cost=50000, opt1.A=1 and opt1.cost=60000, opt1.A=1 and opt1.cost=70000, opt1.A=1 and opt1.cost=80000,
opt1.A=2 and opt1.cost=20000, opt1.A=2 and opt1.cost=30000, opt1.A=2 and opt1.cost=70000, opt1.A=2 and opt1.cost=80000,
opt1.A=3 and opt1.cost=20000, opt1.A=1 and opt1.cost=30000, opt1.A=1 and opt1.cost=40000, opt1.A=3 and opt1.cost=50000,
opt2.A=1 and opt2.cost=50000, opt2.A=1 and opt2.cost=60000, opt2.A=1 and opt2.cost=70000, opt2.A=1 and opt2.cost=80000,
opt2.A=2 and opt2.cost=20000, opt2.A=2 and opt2.cost=30000, opt2.A=2 and opt2.cost=70000, opt2.A=2 and opt2.cost=80000,
opt2.A=3 and opt2.cost=20000, opt2.A=1 and opt2.cost=30000, opt2.A=1 and opt2.cost=40000, opt2.A=3 and opt2.cost=50000,
opt3.A=1 and opt3.cost=50000, opt3.A=1 and opt3.cost=60000, opt3.A=1 and opt3.cost=70000, opt3.A=1 and opt3.cost=80000,
opt3.A=2 and opt3.cost=20000, opt3.A=2 and opt3.cost=30000, opt3.A=2 and opt3.cost=70000, opt3.A=2 and opt3.cost=80000,
opt3.A=3 and opt3.cost=20000, opt3.A=1 and opt3.cost=30000, opt3.A=1 and opt3.cost=40000, opt3.A=3 and opt3.cost=50000
;model:
U(opt1) = b1[0.000001]*A[1,2,3] + b2[0.000001]*B[1,2,3] + b3*C[20,40,60,80] + b4[-0.000001]*cost[20000:80000:10000] + b5[0.000001]*E[500:800:100] + b6[0.000001]*F[2,4,6,8] /
U(opt2) = b1*A+ b2*B+ b3*C+ b4*cost+ b5*E+ b6*F/
U(opt3) = b1*A+ b2*B+ b3*C+ b4*cost+ b5*E+ b6*F/
U(optout) = b7[0]
$
Note that the modified Federov algorithm does not impose attribute level balance, so you may see in the resulting design that it mainly uses outer levels for your numerical attributes. You can either impose attribute level constraints in your utility functions, such as b1[...] * A[1,2,3](40-80,40-80,40-80). Alternatively, you can dummy code all variables. The latter is my preferred way of dealing with this if you have uninformative near-zero priors and this automatically results in a design that is reasonable attribute level balanced.
Further, note that the modified Federov algorithm is quite slow when you have so many rows (in your case, 180), so you will need to run it for a long time.
3) Yes it is correct. The utility function of the optout is either a constant only (as in your case), or zero (and then you put the constant in opt1, opt2, and opt3). If it is zero, then you simply leave out the alternative in the specification.
Michiel
PS: Please post Ngene related questions in the Ngene forum.