;Reject: and ;Require: in heterogeneous design

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

;Reject: and ;Require: in heterogeneous design

Postby jshr » Fri Oct 19, 2018 1:57 pm

Hi

This is actually a follow up question from a post on Stated Experiment Design Forum. I would like to design an experiment with 2 alternatives and 1 SQ, where the attribute levels of SQ will be determined by respondents choices. For example, I have the following syntax for 3 status quo. I question is how to set up the ;require: conditions for each of the models (SQ1, SQ2, SQ3). I read another post and tried using Model_Name.Alt_Name.Att_Name, but it does not work properly. Any suggestions on how to do this?

Another minor question. Do we need to specify the levels and priors in each model (as I am doing in the code below), even if they are the same across models?

Thank you!

Code: Select all
Design
;alts(SQ1) = alt1*, alt2*, quo
;alts(SQ2) = alt1*, alt2*, quo
;alts(SQ3) = alt1*, alt2*, quo
;rows = 7
;eff = fish(mnl,d)
;fisher(fish) = des1(SQ1[0.33]) + des2(SQ2[0.33]) + des3(SQ3[0.34])
;alg = mfederov(candidates=1000)
;rdraws = gauss(3)
;rep = 500

;require:
SQ1.quo.fire = 0,
SQ1.quo.habitat = 1,
SQ1.quo.visibility = 1,
SQ1.quo.cost = 0,

SQ2.quo.fire = 0,
SQ2.quo.habitat = 0,
SQ2.quo.visibility = 0,
SQ2.quo.cost = 0,

SQ3.quo.fire = 0,
SQ3.quo.habitat = 0,
SQ3.quo.visibility = 1,
SQ3.quo.cost = 0,

alt1.cost <> 0,
alt2.cost <> 0

; reject:
alt1.habitat=0 and alt1.fire=2,
alt1.visibility=2 and alt1.fire=2,
alt2.habitat=0 and alt2.fire=2,
alt2.visibility=2 and alt2.fire=2

;model(SQ1):
U(alt1) = f.dummy[n, 1,1|n,0.5,1]*fire[0,1,2] +
          h.dummy[n,-2,1|n,-0.5,1]*habitat[0,1,2] +
          v.dummy[n,-1,1|n,-0.3,1]*visibility[0,1,2] +
          c[-0.01]*cost[0,50,100,150,200,250]
/
U(alt2) = f*fire + h*habitat + v*visibility + c*cost
/
U(quo) =  const[0]+f*fire + h*habitat + v*visibility + c*cost

;model(SQ2):
U(alt1) = f.dummy[n, 1,1|n,0.5,1]*fire[0,1,2] +
          h.dummy[n,-2,1|n,-0.5,1]*habitat[0,1,2] +
          v.dummy[n,-1,1|n,-0.3,1]*visibility[0,1,2] +
          c[-0.01]*cost[0,50,100,150,200,250]
/
U(alt2) = f*fire + h*habitat + v*visibility + c*cost
/
U(quo) =  const[0]+f*fire + h*habitat + v*visibility + c*cost

;model(SQ3):
U(alt1) = f.dummy[n, 1,1|n,0.5,1]*fire[0,1,2] +
          h.dummy[n,-2,1|n,-0.5,1]*habitat[0,1,2] +
          v.dummy[n,-1,1|n,-0.3,1]*visibility[0,1,2] +
          c[-0.01]*cost[0,50,100,150,200,250]
/
U(alt2) = f*fire + h*habitat + v*visibility + c*cost
/
U(quo) =  const[0]+f*fire + h*habitat + v*visibility + c*cost

$
jshr
 
Posts: 6
Joined: Tue Oct 16, 2018 1:43 pm

Re: ;Reject: and ;Require: in heterogeneous design

Postby Michiel Bliemer » Fri Oct 19, 2018 3:57 pm

Heterogeneous designs (using the fisher command) unfortunately have limitations, namely:
* it is not compatible with the modified federov algorithm (but is with the swapping algorithm)
* it is not compatible with constraints

It is on the list for a future version to extend this functionality, but at the moment the combination that you are trying is not yet possible.

Instead of optimising for all three designs simultaneously, I suggest that you optimise them individually, for example using syntax as below.

Code: Select all
Design
;alts = alt1*, alt2*, quo
;rows = 12
;block = 2
;eff = (mnl,d)
;alg = mfederov
;rdraws = gauss(3)
;rep = 500

;require:
quo.fire = 0,
quo.habitat = 1,
quo.visibility = 1,
quo.cost = 0,
alt1.cost > 0,
alt2.cost > 0

; reject:
alt1.habitat=0 and alt1.fire=2,
alt1.visibility=2 and alt1.fire=2,
alt2.habitat=0 and alt2.fire=2,
alt2.visibility=2 and alt2.fire=2

;model:
U(alt1) = f.dummy[n, 1,1|n,0.5,1]*fire[0,1,2] +
          h.dummy[n,-2,1|n,-0.5,1]*habitat[0,1,2] +
          v.dummy[n,-1,1|n,-0.3,1]*visibility[0,1,2] +
          c[-0.01]*cost[0,50,100,150,200,250] /
U(alt2) = f*fire + h*habitat + v*visibility + c*cost /
U(quo) =  const[0]+f*fire + h*habitat + v*visibility + c*cost
$


Please note that the modified Federov algorithm does not impose attribute level balance, so please check the levels for cost. The swapping algorithm will likely not find a design because you have many constraints.

You can calculate the joint D-error manually if you like by summing the individual Fisher matrices (in Excel), taking the inverse, taking the determinant, and taking to the power 1/6 (6 is the number of parameters, excl constants).

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

Re: ;Reject: and ;Require: in heterogeneous design

Postby jshr » Sat Oct 20, 2018 12:19 am

Thanks again, Michiel. I read your reply to my question on stated choice design forum and thought NGENE was able to do heterogeneous design with constraints. Obviously I was wrong.

I ran the code your provided and indeed found that the cost attribute is pretty unbalance. Any suggestions on how to somewhat remedy this? I tried putting constrains on the numbers of levels, but NGENE finished the run immediately and did not provide any result. What did I do wrong?

;model:
U(alt1) = f.dummy[n,-2,1|n,-1,1]*fire[0,1,2] +
h.dummy[n,-3,1.5|n,-1,1]*habitat[0,1,2] +
v.dummy[n,-1.5,1|n,-0.5,1]*visibility[0,1,2] +
c[-0.01]*cost[0,50,100,150,200,250](1-3,1-3,1-3,1-3,1-3,1-3)

Thank you,
Jimmy
jshr
 
Posts: 6
Joined: Tue Oct 16, 2018 1:43 pm

Re: ;Reject: and ;Require: in heterogeneous design

Postby Michiel Bliemer » Sat Oct 20, 2018 10:29 am

You are not really doing anything wrong, the design is just already very heavily constrained and the attribute level constraints you have added make it even more difficult for Ngene to find a design that has atttribute level balance.

Efficiency and attribute level balance are objectives that are generally not aligned. An efficient design with linearly coded attributes (in your case, cost) will usually not have attribute level balance. In your syntax you are asking Ngene to impose several hard constraints on the levels but Ngene finds it difficult to find a feasible design.

A solution could be to impose soft attribute level constraints as follows (see page 141 in the manual):

;eff = (mnl,d) + 0.5*(imbalance)

By increasing the value 0.5 you are putting more weight on attribute level balance, but it will result in less efficiency.

If you are still not happy with the final outcome, there is nothing stopping you from manually changing some of the values in your design (which will result in somewhat less efficiency but you will have more attribute level balance).

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

Re: ;Reject: and ;Require: in heterogeneous design

Postby jshr » Sat Oct 20, 2018 1:01 pm

Michiel,

I see. Thank you again for the prompt responses and great suggestions.

Jimmy
jshr
 
Posts: 6
Joined: Tue Oct 16, 2018 1:43 pm

Re: ;Reject: and ;Require: in heterogeneous design

Postby jshr » Thu Oct 25, 2018 2:01 am

Hi

Another follow up question.

I use the code suggested (attached below), and got a design with a situation with one alternative has the same attribute levels (other than cost) with those in the status quo. In that situation that alternative is then clearly dominated by the status quo (since cost is higher). The same happened with several other designs with different status quo. How could this be fixed?

Thanks,
Jimmy


Code: Select all
Design
;alts = alt1*, alt2*, quo
;rows = 8
;eff=(mnl,d)
;alg = mfederov(candidates=1000, stop=total(1000000 iterations))
;rdraws = gauss(3)
;rep = 500

;require:
quo.fire = 0, quo.habitat = 2, quo.visibility = 0, quo.cost = 0,
alt1.cost <> 0,alt2.cost <> 0, alt1.cost <> alt2.cost

; reject:
alt1.habitat=0 and alt1.fire=2,
alt1.visibility=2 and alt1.fire=2,
alt2.habitat=0 and alt2.fire=2,
alt2.visibility=2 and alt2.fire=2

;model:
U(alt1) = f.dummy[n,-2,1|n,-1,1]*fire[0,1,2] +
          h.dummy[n,-3,1.5|n,-1,1]*habitat[0,1,2] +
          v.dummy[n,-1.5,1|n,-0.5,1]*visibility[0,1,2] +
          c[-0.01]*cost[0,100,200] /
U(alt2) = f*fire + h*habitat + v*visibility + c*cost /
U(quo)  = const[0]+f*fire + h*habitat + v*visibility + c*cost
$
jshr
 
Posts: 6
Joined: Tue Oct 16, 2018 1:43 pm

Re: ;Reject: and ;Require: in heterogeneous design

Postby Michiel Bliemer » Thu Oct 25, 2018 9:37 am

Simply add also an asterisk to the quo alternative:
;alts = alt1*, alt2*, quo*

Best wishes,
Michiel
Michiel Bliemer
 
Posts: 1727
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 5 guests