Page 1 of 1

D optimality of zero after small change to code

PostPosted: Thu Jan 14, 2021 2:39 pm
by Richard Norman
Hi,

I noticed something I couldn't explain when running code, and hoped I could get some collective advice on it. I ran the following code to generate a d-efficient design:

Design
;alts = alt1, alt2
;rows = 120
;eff = (mnl,d)
;block = 10

;model:
U(alt1) = b1.dummy[-0.03|-0.02|-0.01] * A[3,2,1,0] + b2.dummy[0] * B[1,0] + b3.dummy[0] * C[1,0] + b4.dummy[0.02|0.01] * D[2,1,0] + b5.dummy[0.02|0.01] * E[2,1,0] + b6.dummy[0|0|0] * F[3,2,1,0]/
U(alt2) = b1.dummy * A[3,2,1,0] + b2.dummy * B[1,0] + b3.dummy * C[1,0] + b4.dummy * D[2,1,0] + b5.dummy * E[2,1,0] + b6.dummy * F[3,2,1,0]$

This appeared to run fine, and I got a reasonably high D optimality score very quickly.

But, then I tweaked the code to add a level to two of the variables:

Design
;alts = alt1, alt2
;rows = 120
;eff = (mnl,d)
;block = 10

;model:
U(alt1) = b1.dummy[-0.04|-0.03|-0.02|-0.01] * A[4,3,2,1,0] + b2.dummy[0] * B[1,0] + b3.dummy[0] * C[1,0] + b4.dummy[0.02|0.01] * D[2,1,0] + b5.dummy[0.02|0.01] * E[2,1,0] + b6.dummy[0|0|0|0] * F[4,3,2,1,0]/
U(alt2) = b1.dummy * A[4,3,2,1,0] + b2.dummy * B[1,0] + b3.dummy * C[1,0] + b4.dummy * D[2,1,0] + b5.dummy * E[2,1,0] + b6.dummy * F[4,3,2,1,0]$

Again, this appears to run well and the D-error drops as expected. But the D optimality stays at 0% irrespective of how long I let it run.

I hope I am not doing something stupid, but could anyone explain why this happens?

Thanks,
Richard

Re: D optimality of zero after small change to code

PostPosted: Thu Jan 14, 2021 4:43 pm
by Michiel Bliemer
D-optimality is defined for optimal orthogonal designs using the equations in the work of Street and Burgess. Such designs are generated when using ;orth = ood.

When using efficient designs, e.g., ;eff = (mnl,d), and having non-zero priors, you you need to look at D-errors because D-optimality is not well-defined, i.e. it cannot handle non-zero priors and it requires an orthogonal design to do the calculations. Note that there exist hardly any orthogonal designs with 5-levels (your attribute F), so this may be one of the reasons. You can check by changing ;eff = (mnl,d) into ;orth = ood. For the first syntax, Ngene is able to find a design, but for the second syntax no orthogonal design exists.

Michiel

Re: D optimality of zero after small change to code

PostPosted: Thu Jan 14, 2021 5:39 pm
by Richard Norman
Thank you Michiel, that's very clear. I really appreciate your prompt and helpful reply.