necessary attribute level balance for constrained attribute

This forum is for posts that specifically focus on the Windows desktop version of Ngene (i.e. all version 1.x releases).

Moderators: Andrew Collins, Michiel Bliemer, johnr

Post Reply
Yana
Posts: 4
Joined: Mon Mar 28, 2016 6:34 pm

necessary attribute level balance for constrained attribute

Post by Yana »

I have a question about how to keep one "necessary" attribute level balance feature for one specific attribute in a constrained design.

As you can see in the first code, I try to make sure when illness type=1 , sick= 0
In the design generated, type=1 only appear very limited times, much fewer than other types. I understand that as it is a constrained design, the level balance for nested attribute will be lost. Even adding (times of level requirements) after attribute will not work in this case.

However in this particular research, to make each respondent see more or less the same times of different types is necessary. The attribute level balance for "type" is desired.
Then in the second code, I randomly tried a way to "fix" this by adding another almost zero level for "sick" : sick[0, 0.0001, 50,100,150]
Somehow the design has balanced level for the attribute "type" now. If this works, I can easily treat sick=0.0001 as 0 in formatting questionnaires.

My question is, does this way of "fix" this problem really fix it? Will it cause other unintended problems? I do not see that for the moment, to me it seems the level of sick=0 and 0.0001 will have no or minimum effect on utility by the current utility function setting. But I am not sure.
I would appreciate a lot if there are other better ways to solve the problem.

Code: Select all

Design
;alts = alt1, alt2,alt3
;rows = 24
;eff=(mnl,d)
;block=3
;cond:

if(alt1.type=1,alt1.sick=[0]),
if(alt1.type<>1,alt1.sick>10),
if(alt2.type=1,alt2.sick=[0]),
if(alt2.type<>1,alt2.sick>10)

;model:
U(alt1)=b0[-0.5]
+b1[0.2|0.5|-0.2].effects*type[0,1,2,3]
+b2[0.01]*sick[0,50,100,150]
+b3[0.05]*die[5,10,20]
+b4[-0.015]*cost[20,50,100]


/
U(alt2)=b0+b1.effects*type+b2*sick+b3*die+b4*cost

$

Code: Select all

Design
;alts = alt1, alt2,alt3
;rows = 24
;eff=(mnl,d)
;block=3
;cond:

if(alt1.type=1,alt1.sick=[0,0.0001]),
if(alt1.type<>1,alt1.sick>10),
if(alt2.type=1,alt2.sick=[0,0.0001]),
if(alt2.type<>1,alt2.sick>10)

;model:
U(alt1)=b0[-0.5]
+b1[0.2|0.5|-0.2].effects*type[0,1,2,3]
+b2[0.01]*sick[0,0.0001,50,100,150]
+b3[0.05]*die[5,10,20]
+b4[-0.015]*cost[20,50,100]


/
U(alt2)=b0+b1.effects*type+b2*sick+b3*die+b4*cost

$
Thanks.
Michiel Bliemer
Posts: 2057
Joined: Tue Mar 31, 2009 4:13 pm

Re: necessary attribute level balance for constrained attrib

Post by Michiel Bliemer »

Using the ;reject command together with the Modified Federov algorithm and requiring balancedness of "type" by adding (6,6,6,6) to the attribute levels is doing what you want I think?

Code: Select all

Design
;alts = alt1, alt2,alt3
;rows = 24
;eff=(mnl,d)
;block=3
;alg = mfederov(candidates = 1000)
;reject:
alt1.type = 1 and alt1.sick = 50,
alt1.type = 1 and alt1.sick = 100,
alt1.type = 1 and alt1.sick = 150,
alt2.type = 1 and alt2.sick = 50,
alt2.type = 1 and alt2.sick = 100,
alt2.type = 1 and alt2.sick = 150
;model:
U(alt1)=b0[-0.5]
    +b1[0.2|0.5|-0.2].effects*type[0,1,2,3](6,6,6,6)
    +b2[0.01]*sick[0,50,100,150]
    +b3[0.05]*die[5,10,20]
    +b4[-0.015]*cost[20,50,100] /
U(alt2)=b0+b1.effects*type+b2*sick+b3*die+b4*cost
$
Yana
Posts: 4
Joined: Mon Mar 28, 2016 6:34 pm

Re: necessary attribute level balance for constrained attrib

Post by Yana »

Dear Michiel, Thanks a lot!
I add some more constraints on the code you suggested and it is working as what I want.

Code: Select all

Design
;alts = alt1, alt2,alt3
;rows = 24
;eff=(mnl,d)
;block=3
;alg = mfederov(candidates = 1000)
;reject:
alt1.type = 1 and alt1.sick = 50,
alt1.type = 1 and alt1.sick = 100,
alt1.type = 1 and alt1.sick = 150,
alt2.type = 1 and alt2.sick = 50,
alt2.type = 1 and alt2.sick = 100,
alt2.type = 1 and alt2.sick = 150,
alt1.type = 0 and alt1.sick=0,
alt1.type = 2 and alt1.sick=0,
alt1.type = 3 and alt1.sick=0,
alt2.type = 0 and alt2.sick=0,
alt2.type = 2 and alt2.sick=0,
alt2.type = 3 and alt2.sick=0

;model:
U(alt1)=b0[-0.5]
    +b1[0.2|0.5|-0.2].effects*type[0,1,2,3](6,6,6,6)
    +b2[0.01]*sick[0,50,100,150]
    +b3[0.05]*die[5,10,20]
    +b4[-0.015]*cost[20,50,100] /
U(alt2)=b0+b1.effects*type+b2*sick+b3*die+b4*cost
$
Michiel Bliemer
Posts: 2057
Joined: Tue Mar 31, 2009 4:13 pm

Re: necessary attribute level balance for constrained attrib

Post by Michiel Bliemer »

Excellent!
phpufter
Posts: 2
Joined: Sat Jan 18, 2014 1:39 pm

Re: necessary attribute level balance for constrained attrib

Post by phpufter »

Yana, just a quick question, how long does your design take before the first attempt pops out? My similar design has run for hours and I still do not see the first attempt. I am curious how long I need to wait before concluding my syntax is wrong. Without constraints the first iteration appears within minutes.
Thansk,
Fern
Michiel Bliemer
Posts: 2057
Joined: Tue Mar 31, 2009 4:13 pm

Re: necessary attribute level balance for constrained attrib

Post by Michiel Bliemer »

Dear Fern,

Ngene should not take more than 1 minute to show a design. If it takes longer, then usually your constraints are too strict, the number of draws is too high, or your model is not estimable. Feel free to start a new discussion to discuss your syntax.

Michiel
Post Reply