Import excel files with candidate sets

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Import excel files with candidate sets

Postby ankaselivanka123 » Mon Jun 13, 2016 8:18 pm

Dear all,

I am currently using the Ngene version 1.1.2, andI have read recently that there is an option of importing the ready files with candidate sets as excel(.xlsx) or ngd. I tried to import the excel file but after I run the syntax with the following ;alg = mfederov(candidates=saveddesign.xlsx) I get the error “Error: The 'mfederov' algorithm has an incorrectly formatted 'candidates' parameter.” In the imported file the attributes are specified, design number and the choice situations are listed according to the manual. I read in one of the previous posts that the function of importing the designs is not currently available in version 1.1.2 but it is possible to get a special build for that.
Here is the link to the previous post with the problem similar to mine
viewtopic.php?f=2&t=228

Thanks in advance,
Your advise would be very helpful.
ankaselivanka123
 
Posts: 12
Joined: Fri Nov 20, 2015 8:10 pm

Re: Import excel files with candidate sets

Postby Andrew Collins » Wed Jun 15, 2016 9:14 am

Dear Anka

The new version is coming shortly, but in the meantime I will need to send you the link to the special build. I will contact you outside of the forum based on the email you used for forum registration. If there are any issues here, you can contact me via contact@choice-metrics.com.

Andrew
Andrew Collins
 
Posts: 78
Joined: Sat Mar 28, 2009 4:48 pm

Re: Import excel files with candidate sets

Postby ankaselivanka123 » Wed Jun 15, 2016 9:03 pm

Thank you so much for your help!
Helped me greatly.

Best wishes
ankaselivanka123
 
Posts: 12
Joined: Fri Nov 20, 2015 8:10 pm

Re: Import excel files with candidate sets

Postby ankaselivanka123 » Thu Sep 29, 2016 12:38 am

Dear all,

I am using the option of a candidate set import in Ngene, although I was faced with the problem. After I generated the design and saved it as the Ngene output file, I tried to open the saved file but Ngene showed me the blanc output. I have this design saved in Excel, but now I would like to see the efficiency measures too. Is that possible to import the design, generated earlier in Ngene, just to check for the MNL efficiency measures?

Thanks in advance,
Anna
ankaselivanka123
 
Posts: 12
Joined: Fri Nov 20, 2015 8:10 pm

Re: Import excel files with candidate sets

Postby Michiel Bliemer » Thu Sep 29, 2016 9:27 am

Yes that is possible. You can use the ;eval command to evaluate the efficiency of a design in either NGD format, CSV, for Excel. See page 22-23 of the Ngene manual regarding the file types and page 178 and further for the eval command, as well as page 222-223.

In short, you can use the design (with or without headers) from Excel and use ;eval = c:\pathname\design.xls
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm

Re: Import excel files with candidate sets

Postby ankaselivanka123 » Tue Dec 13, 2016 10:25 pm

Dear all,

Thanks a lot for your help with installing the built-in function. I have a question regarding the format of the imported candidate sets. The manual states that Excel files (including the new .xlsx and
.xlsm file formats), comma separated (CSV) files, semicolon delimited files, and tab delimited files are supported.
However, I have a huge candidate set of 1,430,000 rows while Excel allows for only 1,048,576. Can I import the other data formats, or can I use two candidate sets for the design generation?

Thanks a lot in advance,
Anna
ankaselivanka123
 
Posts: 12
Joined: Fri Nov 20, 2015 8:10 pm

Re: Import excel files with candidate sets

Postby Michiel Bliemer » Wed Dec 14, 2016 9:07 am

It is not possible to use multiple candidate sets into the syntax in Ngene.

I am not sure why you would want to import such a large candidate set. Typically it is sufficient to have a candidate set of 500 to 5000 rows or so in order to create an efficient design, therefore I would suggest that you randomly select a subset of your very large set as such a large set will make the algorithm extremely slow when finding an efficient design. You can take a random subset also multiple times and find an efficient design for each subset, which I suspect will have similar efficiencies. Finally, you could also split the candidate set up in two parts, and find an efficient design for each part. These parts are again very large and the algorithm may be very slow.
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm

Re: Import excel files with candidate sets

Postby AVON » Wed Mar 22, 2023 10:37 pm

Dear all,

I'll see that all of you have technical issues corresponding to my current problem, hence I allow myself to post in this thread.

Employing Ngene and excel, I have succeeded in creating an external candidate set consisting of 2.000 randomly selected choice sets with uni-attribute level overlap from a primary candidate set of approx. 60.000 choice sets. The external candidate set is intended for the generation of an explicit partial profile D-efficient design constituted of 12 choice sets with uni-attribute level overlap (2 alternatives per choice set). Each alternative is generated from five attributes, each with three levels. When trying to import the external candidate set into Ngene as a (...).xlsx - file, according to the manuals formatting criteria (1. column with 1's, 2. column with the choice set number, 1 rowe with heading - please see https://i.imgur.com/FuGxnHd.png), I receive the following error message:

"Error: The 'candidates' parameter of the Modified Fedorov algorithm is neither specified as a valid number, nor a valid file name or path"

The Ngene-code is as follows:
---------------
Design
;alts= alt1, alt2
;rows = 12
;eff = (mnl,d)
;alg = mfederov(candidates = ExtCandSet_Import1.xlsx)
;model:
U(alt1) = b1[0.2] * AU[1,2,0] + b2[0.4] * VU[1,2,0] + b3[0.6] * SYN[1,2,0] + b4[-0.3] * IKF[1,2,0] + b5[1.1] * VKF[1,2,0] /
U(alt2) = b1 * AU + b2 * VU + b3 * SYN + b4 * IKF + b5 * VKF
$
---------------
The external set of candidates, ExtCandSet_Import1.xlsx, is located in the project folder (as seen in the screenshot). Do any of you know how to address the problem?

Sincerely,
Alexander
AVON
 
Posts: 2
Joined: Sun Feb 05, 2023 4:35 am

Re: Import excel files with candidate sets

Postby Michiel Bliemer » Thu Mar 23, 2023 11:13 am

Hi Alexander,

It means that Ngene cannot find the file, which is strange because it seems available in your project. I took your script, and created my own random candidate set and ran your script. It runs fine for me.

What I did:

1. I created the spreadsheet, saved it, and closed it
2. I created a project in Ngene
3. I copied your syntax into a script
4. I opened the spreadsheet in Ngene using File | Open, which automatically copies it to the project folder
5. I ran the script

Could you perhaps create a new project and do the same? Please do not manually copy the spreadsheet into the Ngene project folder, just use File | Open. Also make sure that the spreadsheet is not open when you run the script.

Let me know if this resolves the issue.

Btw, if your variables are categorical, as your levels 0,1,2 seem to suggest, you need to use b1.dummy[..|..] * AU[1,2,0] etc. But this is of course not the reason of the error that you get.

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

Re: Import excel files with candidate sets

Postby AVON » Fri Mar 24, 2023 6:04 am

Hi Michel,

Thanks a lot for the fast reply. I solved the problem by uninstalling Ngene and changing the rights for the Ngene-source file. Afterwards, it ran perfectly. Considering your dummy-coding notion, you are completely right. During the troubleshooting, I primitivized the original code and forgot to make the right adjustments.

Thanks for your help,
Alexander
AVON
 
Posts: 2
Joined: Sun Feb 05, 2023 4:35 am


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 23 guests