Import choice situations

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Import choice situations

Postby BaibaP » Mon Dec 08, 2014 9:00 pm

Dear moderators and users,

I am very happy to find this forum, it is great to have a place, where the questions are answered so quickly.

My problem is following: I would like to generate an efficient design, but only specific combinations of attribute levels are allowed.
More specifically, the attribute levels are computed from other attributes which are not a part of the design (it is a travel time reliability research with scheduling approach).
I was suggested that it is possible to supply ready choice situations to Ngene, and the program would find a subset with lowest errors.
However, my attempts to do so have failed so far.

My syntax:
Design
;alts = alt1, alt2
;rows = 8
;eff = (mnl,d)
;alg = mfederov(candidates=C:\Users\...\my_design project\my_design project files\import_my_design.ngd)
;model:
U(alt1) = b1[-0.1] * twmean[2.125,2.5,3.571,3.786,4.643,5.05,5.2,5.8] + b2[-0.1] * tv[20,30,40] + b3[-0.6] * earliness[0,4.264,4.504,4.632,4.816,4.883,4.954,4.987,4.999,9.97,9.999,11.392,12.133,12.143,13.468,13.881,13.966,14.262,14.632,14.662,14.765,14.908,14.974,14.998,19.939,19.998,21.238,22.124,22.143,23.877,24.662] + b4[-1.2] * lateness[0,0.001,0.002,0.006,0.007,0.011,0.018,0.027,0.038,0.056,0.069,0.093,0.131,0.218,0.459,0.68,2.671,3.127,3.948,4.106,5.066,5.276,5.557,6.234] + b5[-2] * tc[120,150,250] + b6[-0.2] * 95wait[43.301,45.945,49.917,57.151,58.931,62.04,66.534,67.852,70.498] /
U(alt2) = b1 * twmean + b2 * tv + b3 * earliness + b4 * lateness + b5 * tc + b6 * 95wait$

I am getting an error message: “Error: The 'mfederov' algorithm has an incorrectly formatted 'candidates' parameter.”

The import_my_design.ngd file was created as a full enumeration of choice situations with the allowed alternatives (the full enumeration has 8646 lines, but the same result was with 100 lines used).
The .ngd file can be opened in the project.
As can be seen from above, I specified all possible attribute levels also in the syntax although they are given in the input file; and I also specified them in the end of .ngd file. I am not sure whether this should be done.

Any help on how to approach my problem will be very appreciated!
Thanks in advance,
Baiba
BaibaP
 
Posts: 7
Joined: Thu Nov 27, 2014 5:43 pm

Re: Import choice situations

Postby Michiel Bliemer » Mon Dec 15, 2014 3:54 pm

I assume you imported an Excel file, which contains appropriate headers and then in each row a possible combination of attribute levels. Make sure that all headers are correct and that all columns are correct. Once read into Ngene, you should be able to use alg = mfederov(candidates = design.ngd) without specifying the folder, as Ngene will know that it has been loaded in the project.

I am not sure what you mean with the fact that you have entered all possible levels at the end of the ngd file, it should only contain a design with choice tasks.
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm

Re: Import choice situations

Postby BaibaP » Tue Dec 16, 2014 4:57 pm

Thank you for the answer!

Yes, indeed there is no difference if the path to the folder is indicated or not.

For creating the input file, I actually used a text editor and followed the example of automatically generated .ngd files.
So, the header is:
Design Choice situation alt1.twmean alt1.tv [and so on, separated by tabs]
Then follow all choice situations.
At the end is a following code:
||||||||||
Design
;alts = Alt1, Alt2
;rows = 100
;eff = (mnl,d)
;model:
U(Alt1) = b1[-0.1] * TWMEAN[2.125,2.5,3.571,3.786,4.643,5.05,5.2,5.8] + b2[-0.1] * TV[20,30,40] + b3[-0.6] * EARLINESS[0,4.264,4.504,4.632,4.816,4.883,4.954,4.987,4.999,9.97,9.999,11.392,12.133,12.143,13.468,13.881,13.966,14.262,14.632,14.662,14.765,14.908,14.974,14.998,19.939,19.998,21.238,22.124,22.143,23.877,24.662] + b4[-1.2] * LATENESS[0,0.001,0.002,0.006,0.007,0.011,0.018,0.027,0.038,0.056,0.069,0.093,0.131,0.218,0.459,0.68,2.671,3.127,3.948,4.106,5.066,5.276,5.557,6.234] + b5[-2] * TC[120,150,250] + b6[-0.2] * 95WAIT[43.301,45.945,49.917,57.151,58.931,62.04,66.534,67.852,70.498] /
U(Alt2) = b1 * TWMEAN + b2 * TV + b3 * EARLINESS + b4 * LATENESS + b5 * TC + b6 * 95WAIT$

Essentially, it is a full code of generating a design, including all possible levels of attributes in the squared brackets (although they are already present in the specified choice situations).
But, if I omit this ending, then the .ngd file is not being opened by Ngene.

I also tried to use an imported excel file, in which case I have alg = mfederov(candidates = design.xlsx). The excel file contains only headers and choice situations.
In all cases I get the same error about incorrectly formatted 'candidates' parameter.

Your advice in how to properly create the .ngd file would be very helpful.
BaibaP
 
Posts: 7
Joined: Thu Nov 27, 2014 5:43 pm

Re: Import choice situations

Postby Andrew Collins » Thu Dec 18, 2014 2:59 pm

The ability to load in an existing design from a .ngd file is in a special build of Ngene, and not the currently available 1.1.2. We will make this functionality available in 1.1.3, which I would like to release early in the new year. However, I am happy to send you a link to this special build, and will do so by email.

The syntax to use is as follows:

Code: Select all
    Design
    ;alts = alt1, alt2
    ;rows = 12
    ;eff = (mnl,d)
    ;alg = mfederov(candidates=SavedDesign.ngd)
    ;model:
    U(alt1) = b1[-0.2] + b2[1.2] * A[0,1,2] + b3[2.5] * B[0,1]     /
    U(alt2) =            b2      * A        + b4[1.1] * C[2,4,6,8] $

The design that is loaded should have the same specification of attributes. You could for example generate and save a full or fractional factorial design, remove the problematic choice tasks using whatever logic fits your situation, then feed this into the above. So this is useful where the ;cond and ;reject properties are not flexible enough.
Andrew Collins
 
Posts: 78
Joined: Sat Mar 28, 2009 4:48 pm

Re: Import choice situations

Postby BaibaP » Thu Dec 18, 2014 4:10 pm

Thank you very much for help!
That is a great and very useful addition.
BaibaP
 
Posts: 7
Joined: Thu Nov 27, 2014 5:43 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 38 guests

cron