How to write a program

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

How to write a program

Postby CMA » Mon Jun 21, 2021 11:25 am

Via Ngene, we created the questionnaire of 2 levels of 9 attributes plus 3 levels of 1 attribute by the following code.

/*** --- Code --- ***/
Design
;alts = alt1, alt2
;rows = 24
;orth = seq
;model:
U(alt1) = b0 + b1 * A[0,1] + b2 * B[0,1] + b3 * C[0,1] + b4 * D[0,1] +b5 * E[0,1] + b6 * F[0,1] + b7 * G[0,1] + b8 * H[0,1] + b9 * I[0,1] + b10 * J[0,1,2]/
U(alt2) = b1 * A + b2 * B + b3 * C + b4 * D +b5 * E + b6 * F + b7 * G + b8 * H + b9 * I + b10 * J
$
/*** --- End of Line --- ***/

Every time we run it, the combination of attribute A stays the same, but that of attribute B fluctuates. Is there any way to make the combination of an option remain unchanged by the same code?
We tried to fix the seed by using ‘rseed’, but it did not work, and hence, the combination of attribute B still changed.
Furthermore, is it possible to make the combination of attribute A change at each run?
CMA
 
Posts: 34
Joined: Mon Jun 14, 2021 3:42 pm

Re: How to write a program

Postby Michiel Bliemer » Mon Jun 21, 2021 11:37 am

Sequential orthogonal designs are created as follows:

1. Find an orthogonal design for Alternative A
2. Create profiles for Allternative B based on a randomisation of the order of the rows for Alternative B

Because of this randomisation, the resulting design is different each time, but the rows used in B are identical, they just appear in a different order.

If you want the exact same design, you should specify that you want a specific sequential orthogonal design, namely a D-optimal orthogonal design. You can do this by replacing ;orth = seq with ;orth = ood. This design maximises trade-offs between the two alternatives and has no random component.

Michiel
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm

Re: How to write a program

Postby CMA » Thu Jun 24, 2021 8:00 pm

Thanks so much for your quick response and your comments.
I have one more question.
Is it possible to use a seed or something so that the combination of attribute A changes each time it is executed?
CMA
 
Posts: 34
Joined: Mon Jun 14, 2021 3:42 pm

Re: How to write a program

Postby Michiel Bliemer » Fri Jun 25, 2021 5:34 pm

No there is currently no such random seed option available, only for Bayesian draws and random draws there are ;bseed and ;rseed.
It is a good suggestion though so we may add such an option in a next version.

Michiel
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 18 guests

cron