Partial profile design "undefined error"

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Partial profile design "undefined error"

Postby Remai » Tue Nov 12, 2024 10:56 pm

I’m attempting to create a partial profile for an unlabelled DCE with 9 attributes, which have between 2-5 levels, and overlapping 4 attributes.

There are a number of illogical combinations with these attributes that have been accounted for within the “reject” criteria in the candidate set script.

I initially created a candidate set with 20,000 rows with the following script:

Code: Select all
Design
;alts = optA*, optB*
;rows = 20000
;eff = (mnl,d)
;alg = mfederov(candidates=20000)

;reject: 
optA.medtype = 0 and optA.medduration = 1 ,
optA.medtype = 0 and optA.medduration = 2 ,
optA.medtype = 0 and optA.medduration = 3 ,
optA.medtype = 1 and optA.medduration = 0 ,
optA.medtype = 2 and optA.medduration = 0 ,
optA.medtype = 3 and optA.medduration = 0 ,
optA.contact = 0 and optA.distance = 1 ,
optA.contact = 0 and optA.distance = 2 ,
optA.contact = 0 and optA.distance = 3 ,
optA.contact = 0 and optA.distance = 4 ,
optA.contact = 1 and optA.distance = 1 ,
optA.contact = 1 and optA.distance = 2 ,
optA.contact = 1 and optA.distance = 3 ,
optA.contact = 1 and optA.distance = 4 ,
optA.contact = 2 and optA.distance = 1 ,
optA.contact = 2 and optA.distance = 2 ,
optA.contact = 2 and optA.distance = 3 ,
optA.contact = 2 and optA.distance = 4 ,
optA.contact = 4 and optA.distance = 1 ,
optA.contact = 4 and optA.distance = 2 ,
optA.contact = 4 and optA.distance = 3 ,
optA.contact = 4 and optA.distance = 4 ,
optA.contact = 3 and optA.distance = 0 ,
optA.structure = 1 and optA.contact = 0 ,
optA.structure = 1 and optA.contact = 1 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 0 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 1 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 2 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 4 ,

optB.medtype = 0 and optB.medduration = 1 ,
optB.medtype = 0 and optB.medduration = 2 ,
optB.medtype = 0 and optB.medduration = 3 ,
optB.medtype = 1 and optB.medduration = 0 ,
optB.medtype = 2 and optB.medduration = 0 ,
optB.medtype = 3 and optB.medduration = 0 ,
optB.contact = 0 and optB.distance = 1 ,
optB.contact = 0 and optB.distance = 2 ,
optB.contact = 0 and optB.distance = 3 ,
optB.contact = 0 and optB.distance = 4 ,
optB.contact = 1 and optB.distance = 1 ,
optB.contact = 1 and optB.distance = 2 ,
optB.contact = 1 and optB.distance = 3 ,
optB.contact = 1 and optB.distance = 4 ,
optB.contact = 2 and optB.distance = 1 ,
optB.contact = 2 and optB.distance = 2 ,
optB.contact = 2 and optB.distance = 3 ,
optB.contact = 2 and optB.distance = 4 ,
optB.contact = 3 and optB.distance = 0 ,
optB.contact = 4 and optB.distance = 1 ,
optB.contact = 4 and optB.distance = 2 ,
optB.contact = 4 and optB.distance = 3 ,
optB.contact = 4 and optB.distance = 4 ,
optB.structure = 1 and optB.contact = 0 ,
optB.structure = 1 and optB.contact = 1 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 0 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 1 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 2 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 4

;model:
U(optA) = b1 * medtype[0, 1, 2, 3]           
+ b2 * medduration[0, 1, 2, 3]             
+ b3 * contact[0, 1, 2, 3, 4]               
+ b4 * structure[0, 1, 2, 3]         
+ b5 * engagement[0, 1]   
+ b6 * distance[0, 1, 2, 3, 4]   
+ b7 * tailoring[0, 1, 2, 3]
+ b8 * tools[0, 1, 2]
+ b9 * cost[0, 1, 2, 3]                 
/
U(optB) = b1 * medtype
+ b2 * medduration             
+ b3 * contact               
+ b4 * structure         
+ b5 * engagement   
+ b6 * distance   
+ b7 * tailoring
+ b8 * tools
+ b9 * cost
$

I then selected the rows with 4 overlapped attribute levels between optA and optB, resulting in 3499 rows. This became “candidate_set_overlap.csv”.

I ran this Ngene script with the candidate set:

Code: Select all
Design
;alts = opta*, optb*, neither
;rows = 60
;block = 6
;eff = (mnl,d)
;alg = mfederov(candidates = candidate_set_overlap.csv)

;model:
U(optA) = b1.dummy[0.000001 | 0.000002 | 0.000003 ]      * medtype [0, 1, 2, 3]      (13-17, 13-17, 13-17, 13-17)
+ b2.dummy[0.000001 | 0.000002 | 0.000003 ]            * medduration [0, 1, 2, 3]   (13-17, 13-17, 13-17, 13-17)
+ b3.dummy[0.000001 | 0.000002 | 0.000003 | 0.000004 ]   * contact [0, 1, 2, 3, 4]   (10-14, 10-14, 10-14, 10-14, 10-14)
+ b4.dummy[0.000001| 0.000002 | 0.000003 ]            * structure [0, 1, 2, 3]   (13-17, 13-17, 13-17, 13-17)
+ b5.dummy[0.000001 ]                         * engagement [0, 1]      (28-32, 28-32)
+ b6.dummy[0.000001 | 0.000002 | 0.000003 | 0.000004 ]   * distance [0, 1, 2, 3, 4]    (10-14, 10-14, 10-14, 10-14, 10-14)
+ b7.dummy[0.000001 | 0.000002 | 0.000003 ]             * tailoring [0, 1, 2, 3]      (13-17, 13-17, 13-17, 13-17)
+ b8.dummy[0.000001 | 0.000002 ]                     * tools [0, 1, 2]      (18-22, 18-22, 18-22)
+ b9.dummy[0.000001 | 0.000002 | 0.000003 ]            * cost [0, 1, 2, 3]      (13-17, 13-17, 13-17, 13-17)
/
U(optB) = b1 * medtype
+ b2 * medduration
+ b3 * contact
+ b4 * structure
+ b5 * engagement
+ b6 * distance
+ b7 * tailoring
+ b8 * tools
+ b9 * cost
$


This produced this error: [Modified Fedorov] ERROR: Unable to find a design that satisfies the specified attribute level frequency constraints. You may need to relax some attribute level constraints, combinatorial constraints (if specified), or dominance checks. The candidate set has 3499 rows.

I then removed the level balance constraints and reran the script. Immediately after beginning the run, the MNL D-Error column was set to “Undefined”. I waited 24 hours and Ngene produced no outputs. When I stopped the script running, there were no errors or messages.

I then tried removing the asterisk from ;alts = optA*, optB*, neither and got the same “Undefined” D-Error as above.

Can you advise me on where I may be going wrong?

Thank you for any assistance you may be able to provide
Remai
 
Posts: 1
Joined: Sun Oct 27, 2024 12:06 pm

Re: Partial profile design "undefined error"

Postby Michiel Bliemer » Fri Nov 15, 2024 12:59 pm

If you run the script below, and you investigate the covariance matrix, you can see that there is an issue with estimating b1 and b2. This is because you have created multicollinearity between medtype and medduration, whereby medtype=0 exclusively occurs with medduration=0 and other medtypes never occur with medduration=0. This means that your model cannot be estimated and as such, an unidentified model yields infinite (Undefined) D-error.

If dummy coded levels are linked together, you will likely need to merge them into a single attribute. You need to be a bit more creative in specifying your utility function. Note that this is not a limitation of Ngene but rather an issue with your model specification.

For example, you have a single dummy variable whether, i.e. typeduration=0 if type=0 and duration=0, and 1 otherwise; and you have a different dummy variable for medtypes=1,2,3 associated with medduration=1,2,3. You would then create an interaction effect with typeduration * medtype and typeduration * medduration. Formulating interactions across dummy variables in Ngene is a bit tricky, so once you have settled on your utility function formulation I can help you further.

Code: Select all
Design
;alts = opta*, optb*, neither
;rows = 60
;block = 6
;eff = (mnl,d)
;alg = mfederov
;reject:
optA.medtype = 0 and optA.medduration = 1 ,
optA.medtype = 0 and optA.medduration = 2 ,
optA.medtype = 0 and optA.medduration = 3 ,
optA.medtype = 1 and optA.medduration = 0 ,
optA.medtype = 2 and optA.medduration = 0 ,
optA.medtype = 3 and optA.medduration = 0 ,
optA.contact = 0 and optA.distance = 1 ,
optA.contact = 0 and optA.distance = 2 ,
optA.contact = 0 and optA.distance = 3 ,
optA.contact = 0 and optA.distance = 4 ,
optA.contact = 1 and optA.distance = 1 ,
optA.contact = 1 and optA.distance = 2 ,
optA.contact = 1 and optA.distance = 3 ,
optA.contact = 1 and optA.distance = 4 ,
optA.contact = 2 and optA.distance = 1 ,
optA.contact = 2 and optA.distance = 2 ,
optA.contact = 2 and optA.distance = 3 ,
optA.contact = 2 and optA.distance = 4 ,
optA.contact = 4 and optA.distance = 1 ,
optA.contact = 4 and optA.distance = 2 ,
optA.contact = 4 and optA.distance = 3 ,
optA.contact = 4 and optA.distance = 4 ,
optA.contact = 3 and optA.distance = 0 ,
optA.structure = 1 and optA.contact = 0 ,
optA.structure = 1 and optA.contact = 1 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 0 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 1 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 2 ,
optA.cost = 3 and optA.medtype = 0 and optA.contact = 4 ,

optB.medtype = 0 and optB.medduration = 1 ,
optB.medtype = 0 and optB.medduration = 2 ,
optB.medtype = 0 and optB.medduration = 3 ,
optB.medtype = 1 and optB.medduration = 0 ,
optB.medtype = 2 and optB.medduration = 0 ,
optB.medtype = 3 and optB.medduration = 0 ,
optB.contact = 0 and optB.distance = 1 ,
optB.contact = 0 and optB.distance = 2 ,
optB.contact = 0 and optB.distance = 3 ,
optB.contact = 0 and optB.distance = 4 ,
optB.contact = 1 and optB.distance = 1 ,
optB.contact = 1 and optB.distance = 2 ,
optB.contact = 1 and optB.distance = 3 ,
optB.contact = 1 and optB.distance = 4 ,
optB.contact = 2 and optB.distance = 1 ,
optB.contact = 2 and optB.distance = 2 ,
optB.contact = 2 and optB.distance = 3 ,
optB.contact = 2 and optB.distance = 4 ,
optB.contact = 3 and optB.distance = 0 ,
optB.contact = 4 and optB.distance = 1 ,
optB.contact = 4 and optB.distance = 2 ,
optB.contact = 4 and optB.distance = 3 ,
optB.contact = 4 and optB.distance = 4 ,
optB.structure = 1 and optB.contact = 0 ,
optB.structure = 1 and optB.contact = 1 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 0 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 1 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 2 ,
optB.cost = 3 and optB.medtype = 0 and optB.contact = 4

;model:
U(optA) = b1.dummy[0.000001 | 0.000002 | 0.000003 ]      * medtype [0, 1, 2, 3]   
+ b2.dummy[0.000001 | 0.000002 | 0.000003 ]            * medduration [0, 1, 2, 3]
+ b3.dummy[0.000001 | 0.000002 | 0.000003 | 0.000004 ]   * contact [0, 1, 2, 3, 4]
+ b4.dummy[0.000001| 0.000002 | 0.000003 ]            * structure [0, 1, 2, 3] 
+ b5.dummy[0.000001 ]                         * engagement [0, 1]   
+ b6.dummy[0.000001 | 0.000002 | 0.000003 | 0.000004 ]   * distance [0, 1, 2, 3, 4]
+ b7.dummy[0.000001 | 0.000002 | 0.000003 ]             * tailoring [0, 1, 2, 3]   
+ b8.dummy[0.000001 | 0.000002 ]                     * tools [0, 1, 2]   
+ b9.dummy[0.000001 | 0.000002 | 0.000003 ]            * cost [0, 1, 2, 3]
/
U(optB) = b1 * medtype
+ b2 * medduration
+ b3 * contact
+ b4 * structure
+ b5 * engagement
+ b6 * distance
+ b7 * tailoring
+ b8 * tools
+ b9 * cost
$


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 12 guests