How to write a program
Posted: 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?
/*** --- 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?