Status quo design with many constraints

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Re: Status quo design with many constraints

Postby Michiel Bliemer » Thu Mar 16, 2023 11:11 pm

There are a lot of constraints in your design so it is difficult to say what causes this. I do notice that in the candidate set type=0 always appears with emission=0, and by requiring that emission=0 appears at least 3 times in each alternative then you automatically create overlap at least 6 times where alt1 or alt2 starts with 0,0. When I run the syntax do I do not really observe so many choice tasks that are identical to the status quo, but I do see some.

To keep more control over the choice set and check whether there are any strange choice tasks, I suggest you do the following.

Step 1: Create and inspect candidate set

Code: Select all
design   ? Context 1 Scenario A design
;alts = sq*, alt1*, alt2*,
;rows = 1500
;fact

;require:  ? fixed reference level for status quo option
sq.type=0,
sq.emission=0,
sq.cost=700,
sq.time=90

? 0=type0, 1=type1, 2=type2, 3=type3

;reject:
?time for type1 is always equal to type0,which is 90
alt1.type=1 AND alt1.time = 105 OR alt1.time = 120 OR alt1.time = 135 OR alt1.time = 150,
alt2.type=1 AND alt2.time = 105 OR alt2.time = 120 OR alt2.time = 135 OR alt2.time = 150,

?time for type2 is always the highest
alt1.type=2 AND alt1.time <= alt2.time,
alt2.type=2 AND alt2.time <= alt1.time,

alt1.type=2 AND alt1.time = 90,
alt2.type=2 AND alt2.time = 90,

? time for type3 is always higher than type0
alt1.type=3 AND alt2.type=0 AND alt1.time <= alt2.time,
alt2.type=3 AND alt1.type=0 AND alt2.time <= alt1.time,

alt1.type=3 AND alt1.time = 90,
alt2.type=3 AND alt2.time = 90,

? time for type3 is always higher than type1
alt1.type=3 AND alt2.type=1 AND alt1.time <= alt2.time,
alt2.type=3 AND alt1.type=1 AND alt2.time <= alt1.time,

? emissions for type0 is the base level, so always 0
alt1.type=0 AND alt1.emission=10 OR alt1.emission=35 OR alt1.emission=60 OR alt1.emission=80 OR alt1.emission=100,
alt2.type=0 AND alt2.emission=10 OR alt2.emission=35 OR alt2.emission=60 OR alt2.emission=80 OR alt2.emission=100,

? emissions for type2 and type3 are always 100
alt1.type=2 AND alt1.emission=10 OR alt1.emission=35 OR alt1.emission=60 OR alt1.emission=80 OR alt1.emission=0,
alt1.type=3 AND alt1.emission=10 OR alt1.emission=35 OR alt1.emission=60 OR alt1.emission=80 OR alt1.emission=0,
alt2.type=2 AND alt2.emission=10 OR alt2.emission=35 OR alt2.emission=60 OR alt2.emission=80 OR alt2.emission=0,
alt2.type=3 AND alt2.emission=10 OR alt2.emission=35 OR alt2.emission=60 OR alt2.emission=80 OR alt2.emission=0,

? emissions for type1 range from 10% to 100%
alt1.type=1 AND alt1.emission=0,   
alt2.type=1 AND alt2.emission=0,

? sq.type=0, don’t want a design that has three type0 option
alt1.type=0 AND alt2.type=0



;model:
U(alt1) =       b0[(n,0.469650837,0.373433012)]
                + btype.dummy[(n,0.24,0.494067)|(n,0.610872,0.431096)|(n,0.231311,0.418886)]*type[1,2,3,0] ?the expected preference order: type2>type1>type3>type0; 0=type0, 1=type1, 2=type2, 3=type3
                + bemission[(n,0.004666,0.004099)]*emission[0,10,35,60,80,100]
                + bcost[(n,-0.0028,0.00054)]*cost[420,560,700,840,980]
                + btime[(n,-0.00998,0.006987)]*time[90,105,120,135,150]

/

U(alt2) =       b0
                + btype*type
                + bemission*emission
                + bcost*cost
                + btime*time

/

U(sq) =           btype*type
                + bemission*emission
                + bcost*cost
                + btime*time
$


Step 2: Save this design as candidateset.ngd

Step 3: Generate a Bayesian efficient design using this candidate set.

Code: Select all
design   ? Context 1 Scenario A design
;alts = sq*, alt1*, alt2*,
;rows = 36
;block= 12
;eff = (mnl,d,median) ? for context 2 I used ;eff = (mnl,d,mean) as 102 data collected
;bdraws = sobol(500)
;alg = mfederov (candidates=candidateset.ngd)
;require:
sq.type=0

;model:
U(alt1) =       b0[(n,0.469650837,0.373433012)]
                + btype.dummy[(n,0.24,0.494067)|(n,0.610872,0.431096)|(n,0.231311,0.418886)]*type[1,2,3,0] ?the expected preference order: type2>type1>type3>type0; 0=type0, 1=type1, 2=type2, 3=type3
                + bemission[(n,0.004666,0.004099)]*emission[0,10,35,60,80,100] (3-36,3-36,3-36,3-36,3-36,3-36)
                + bcost[(n,-0.0028,0.00054)]*cost[420,560,700,840,980](4-36,4-36,4-36,4-36,4-36)
                + btime[(n,-0.00998,0.006987)]*time[90,105,120,135,150](4-36,4-36,4-36,4-36,4-36)

/

U(alt2) =       b0
                + btype*type
                + bemission*emission
                + bcost*cost
                + btime*time

/

U(sq) =           btype*type
                + bemission*emission_sq[0]
                + bcost*cost_sq[700]
                + btime*time_sq[90]
$


When I do this, the candidate set does not have any alternatives that are identical to the status quo and the design does not suffer from this issue. In my script the candidate set is generated slightly differently, which allows the dominance constraints to be applied more properly because in my script the attributes for the status quo alternative have the same name as the attributes in the other alternatives.

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

Re: Status quo design with many constraints

Postby peggy » Fri Mar 17, 2023 9:52 am

Hi Michiel,

Many thanks for your swift reply.

The code you wrote for the candidate set run perfectly fine on my machine. However, I forgot I changed the name for dummy_coded variables in the script that I provided you, namely, in the condition below, time for type3 should be the highest.

so I changed this part of the condition:
Code: Select all
?time for type2 is always the highest
alt1.type=2 AND alt1.time <= alt2.time,
alt2.type=2 AND alt2.time <= alt1.time,

alt1.type=2 AND alt1.time = 90,
alt2.type=2 AND alt2.time = 90,

? time for type3 is always higher than type0
alt1.type=3 AND alt2.type=0 AND alt1.time <= alt2.time,
alt2.type=3 AND alt1.type=0 AND alt2.time <= alt1.time,

alt1.type=3 AND alt1.time = 90,
alt2.type=3 AND alt2.time = 90,

? time for type3 is always higher than type1
alt1.type=3 AND alt2.type=1 AND alt1.time <= alt2.time,
alt2.type=3 AND alt1.type=1 AND alt2.time <= alt1.time,


by replacing type 2 with type 3 ( and type 3 with type 2), this is the right condition that I used in the pilot study and also in pilot estimation.

The modified full_code is shown below, but this script cannot run on Ngene, every time I tried to run it, the software collapsed and gave me the message :
"Something went unexpectedly wrong. It may be something as simple as an error in the syntax that Ngene did not detect, or something a little more tricky.
Aborted"

I've checked the syntax multiple time, I merely changed the dummy-coded variable. I've also tried to create a candidate set for Scenario B and C, where the type is reduced to 3 (type 0,1,2), but the software keeps collapsing. So far, Ngene can only run the candidate set script that you provided and I couldn't modify it. Do you know why this is happening?

Code: Select all
design    ?Candidate set for context 1 scenario A design
;alts = sq*, alt1*, alt2*,
;rows = 1500
;fact

;require:  ? fixed reference level for status quo option
sq.type=0,
sq.emission=0,
sq.cost=700,
sq.time=90

? 0=type0, 1=type1, 2=type2, 3=type3


;reject:
?time for type1 is always equal to type0,which is 90
alt1.type=1 AND alt1.time = 105 OR alt1.time = 120 OR alt1.time = 135 OR alt1.time = 150,
alt2.type=1 AND alt2.time = 105 OR alt2.time = 120 OR alt2.time = 135 OR alt2.time = 150,

?time for type3 is always the highest
alt1.type=3 AND alt1.time <= alt2.time,
alt2.type=3 AND alt2.time <= alt1.time,

alt1.type=3 AND alt1.time = 90,
alt2.type=3 AND alt2.time = 90,

? time for type2 is always higher than type0
alt1.type=2 AND alt2.type=0 AND alt1.time <= alt2.time,
alt2.type=2 AND alt1.type=0 AND alt2.time <= alt1.time,

alt1.type=2 AND alt1.time = 90,
alt2.type=2 AND alt2.time = 90,

? time for type2 is always higher than type1

alt1.type=2 AND alt2.type=1 AND alt1.time <= alt2.time,
alt2.type=2 AND alt1.type=1 AND alt2.time <= alt1.time,

? emissions for type0 is the base level, so always 0

alt1.type=0 AND alt1.emission=10 OR alt1.emission=35 OR alt1.emission=60 OR alt1.emission=80 OR alt1.emission=100,
alt2.type=0 AND alt2.emission=10 OR alt2.emission=35 OR alt2.emission=60 OR alt2.emission=80 OR alt2.emission=100,

? emissions for type2 and type3 are always 100

alt1.type=3 AND alt1.emission=10 OR alt1.emission=35 OR alt1.emission=60 OR alt1.emission=80 OR alt1.emission=0,
alt1.type=2 AND alt1.emission=10 OR alt1.emission=35 OR alt1.emission=60 OR alt1.emission=80 OR alt1.emission=0,
alt2.type=3 AND alt2.emission=10 OR alt2.emission=35 OR alt2.emission=60 OR alt2.emission=80 OR alt2.emission=0,
alt2.type=2 AND alt2.emission=10 OR alt2.emission=35 OR alt2.emission=60 OR alt2.emission=80 OR alt2.emission=0,

? emissions for type1 range from 10% to 100%

alt1.type=1 AND alt1.emission=0,   
alt2.type=1 AND alt2.emission=0,

? sq.type=0, don’t want a design that has three type0 option
alt1.type=0 AND alt2.type=0



;model:
U(alt1) =       b0[(n,0.469650837,0.373433012)]
                + btype.dummy[(n,0.24,0.494067)|(n,0.610872,0.431096)|(n,0.231311,0.418886)]*type[1,2,3,0]
                + bemission[(n,0.004666,0.004099)]*emission[0,10,35,60,80,100]
                + bcost[(n,-0.0028,0.00054)]*cost[420,560,700,840,980]
                + btime[(n,-0.00998,0.006987)]*time[90,105,120,135,150]

/

U(alt2) =       b0
                + btype*type
                + bemission*emission
                + bcost*cost
                + btime*time

/

U(sq) =           btype*type
                + bemission*emission
                + bcost*cost
                + btime*time
$



I really appreciate your help.

Peggy
peggy
 
Posts: 7
Joined: Mon Jan 23, 2023 10:56 pm

Re: Status quo design with many constraints

Postby Michiel Bliemer » Fri Mar 17, 2023 12:41 pm

It cannot find 1500 rows. If you modify it to 1400 rows it will find a candidate set.
I will report that this script crashes Ngene so that we can fix this for a future version.

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

Previous

Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 14 guests