How to analyze labeled experimental data with different attr

This forum is for posts covering broader stated choice experimental design issues.

Moderators: Andrew Collins, Michiel Bliemer, johnr

How to analyze labeled experimental data with different attr

Postby linger9085 » Sat Jan 06, 2024 2:31 pm

Dear Ngene Software Expert Team, I have a question and seek your assistance. I am a beginner to the choice-metrics model. And I am learning the manual.
My question is not about design, but about how to analyze labeled experimental data with different attributes.
In the manual page 194, an example of syntax is below:
Design
;alts = car, train, bus, tram, bike
;rows = 15
;eff = (mnl,d)
;model:
U(car) = b1[0.3] +
b2[-0.05] * ctime[15,20,25] +
b3[-0.3] * fuel[1,2] +
b4[-0.4] * toll[0,1] /
U(train) = b5[0.2] +
b6[-0.04] * ttime[10,15,20] +
b7[-0.08] * accegg[5,10,15] +
b8[-0.08] * transfer[0,5,10] +
b9[-0.3] * fare[2,3] /
U(bus) = b10[-0.2] +
b11[-0.06] * btime[15,20,25] +
b7 * accegg +
b8 * transfer +
b9 * fare2[1,2] /
U(tram) = b12[0.1] +
b6 * ttime +
b7 * accegg +
b8 * transfer +
b9 * fare2 /
U(bike) = b13[-0.08] * biketime[20,30,40]
$

If I use the above design for a questionnaire survey and collect data. Then eg alternative "car" won't have "accegg", "transfer", "fare" data. for first choice data would like below
resp_id grid set_id alt_id selected travel time accegg time transfer time fuel cost toll cost fare
1 1 1 1 1 15 - - 1 1 -
1 1 1 2 0 10 15 0 - - 2
1 1 1 3 0 15 5 5 - - 1
1 1 1 4 0 20 5 0 - - 1
1 1 1 5 0 30 - - - - -

If I use STATA software to analyze the data above. For attributes that are not available, should I assign a value of 0, leave it empty as a missing value, or assign a value of other missing values?
I don't know if my understanding is correct. In STATA or other statistical analysis software, if there are missing values in a row of data, during modeling, the entire row of data with missing values will be deleted, and only the complete data row will be retained.
But if assigned a value of 0 or other numerical values, is modeling correct?

Looking forward to your reply and answer, thank you very much!
Best Regards
linger9085
 
Posts: 8
Joined: Fri Dec 29, 2023 5:53 pm

Re: How to analyze labeled experimental data with different

Postby Michiel Bliemer » Sat Jan 06, 2024 2:47 pm

Each choice model estimation software, which can be Nlogit, Biogeme, Apollo, Stata, etc., has their own data format. The format for Apollo and Biogeme is similar to Ngene, namely each choice task is in a row and all attributes of all alternatives are listed in the same row, while in Nlogit each alternative is in a row, also referred to as long format.

For example, in Biogeme/Apollo the data set would look something like:

respid choiceset choice car_ctime car_fuel car_toll train_ttime train_accegg train_transfer train_fare etc.
1 1 1 15 2 1 10 5 5 2 20 5 10 1 etc
1 2 etc

In this format there is no need to set any zeros for attributes.

In Nlogit, the format will be something like:
respid choiceset choice alternative ctime fuel toll ttime acceff transfer fare etc
1 1 1 1 15 1 1 0 0 0 0 0 etc <using zeros for attributes that do not appear in car>
1 1 1 2 0 0 0 10 5 5 2 etc <using zeros for attributes that do not appear in train>
1 1 1 3 etc

I have not used Stata before, so you will have to look at the manual what the correct data format is for estimating choice models in Stata.

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

Re: How to analyze labeled experimental data with different

Postby linger9085 » Mon Jan 08, 2024 7:19 pm

Thank you, Professor, for your patient guidance.
The data format of STATA is similar to that of Nlogit, which is called long data. I will refer to the example you provided for application.
linger9085
 
Posts: 8
Joined: Fri Dec 29, 2023 5:53 pm


Return to Choice experiments - general

Who is online

Users browsing this forum: Michiel Bliemer and 17 guests