Hello
I want to estimate an RPL model in wtp space, where all wtp-parameters should be specified to take normal distributions, and the cost-parameter to take a lognormal distribution. First, I am estimating MNL models to figure out the wtp-space specification.
This works nicely with the specification below. However, this gives the SQ-parameter is preference space, not a wtp estimate. I have seen in the examples that you provide (example 16) that this is how you specify the ASCs.
V = list()
V[['alt_A']] = b_price * ( w_alt_A + w_org*org1 + price1 )
V[['alt_B']] = b_price * ( w_alt_B + w_org*org2 + price2 )
V[['alt_C']] = b_price * ( w_alt_C + w_org*org3 + price3 )
V[['alt_sq']] = b_sq
(w_alt_A=fixed to 0)
However, I want to estimate the SQ-parameter ("Don't buy") in wtp-space. This is what I obtain with the “mixlogitwtp”-command in STATA. My attempts to do so in Apollo have failed, and I therefore ask for your kind advice on what I do wrong. In the specifications below, I get “Inf” for all standard errors.
V = list()
V[['alt_A']] = b_price * ( w_alt_A + w_org*org1 + price1 )
V[['alt_B']] = b_price * ( w_alt_B + w_org*org2 + price2 )
V[['alt_C']] = b_price * ( w_alt_C + w_org*org3 + price3 )
V[['alt_sq']] = b_price * ( w_sq )
V = list()
V[['alt_A']] = b_price * ( w_alt_A + w_org*org1 + price1 )
V[['alt_B']] = b_price * ( w_alt_B + w_org*org2 + price2 )
V[['alt_C']] = b_price * ( w_alt_C + w_org*org3 + price3 )
V[['alt_sq']] = b_price * ( w_sq + price4 )
(price4=0 for all tasks.)
Thank you very much in advance!
Important: Read this before posting to this forum
- This forum is for questions related to the use of Apollo. We will answer some general choice modelling questions too, where appropriate, and time permitting. We cannot answer questions about how to estimate choice models with other software packages.
- There is a very detailed manual for Apollo available at http://www.ApolloChoiceModelling.com/manual.html. This contains detailed descriptions of the various Apollo functions, and numerous examples are available at http://www.ApolloChoiceModelling.com/examples.html. In addition, help files are available for all functions, using e.g. ?apollo_mnl
- Before asking a question on the forum, users are kindly requested to follow these steps:
- Check that the same issue has not already been addressed in the forum - there is a search tool.
- Ensure that the correct syntax has been used. For any function, detailed instructions are available directly in Apollo, e.g. by using ?apollo_mnl for apollo_mnl
- Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
- Make sure that R is using the latest official release of Apollo.
- Users can check which version they are running by entering packageVersion("apollo").
- Then check what is the latest full release (not development version) at http://www.ApolloChoiceModelling.com/code.html.
- To update to the latest official version, just enter install.packages("apollo"). To update to a development version, download the appropriate binary file from http://www.ApolloChoiceModelling.com/code.html, and install the package from file
- If the above steps do not resolve the issue, then users should follow these steps when posting a question:
- provide full details on the issue, including the entire code and output, including any error messages
- posts will not immediately appear on the forum, but will be checked by a moderator first. This may take a day or two at busy times. There is no need to submit the post multiple times.
WTW space with random coefficients
-
- Site Admin
- Posts: 1049
- Joined: 24 Apr 2020, 16:29
Re: wtp space
Hi Anna
your specification looks correct, but if price4==0 for all, then you can just write:
V = list()
V[['alt_A']] = b_price * ( w_alt_A + w_org*org1 + price1 )
V[['alt_B']] = b_price * ( w_alt_B + w_org*org2 + price2 )
V[['alt_C']] = b_price * ( w_alt_C + w_org*org3 + price3 )
V[['alt_sq']] = b_price * w_sq
Can you show us the output for both models, please?
Also, I assume you mean negative Lognormal for price?
Best wishes
Stephane
your specification looks correct, but if price4==0 for all, then you can just write:
V = list()
V[['alt_A']] = b_price * ( w_alt_A + w_org*org1 + price1 )
V[['alt_B']] = b_price * ( w_alt_B + w_org*org2 + price2 )
V[['alt_C']] = b_price * ( w_alt_C + w_org*org3 + price3 )
V[['alt_sq']] = b_price * w_sq
Can you show us the output for both models, please?
Also, I assume you mean negative Lognormal for price?
Best wishes
Stephane
-
- Posts: 6
- Joined: 27 Apr 2020, 20:01
Re: wtp space
Dear Stephane
Thank you very much for the quick response!
Yes, true, I meant negative lognormal distribution for the cost parameter.
The following model specification and results are with the sq-parameter in wtp-space:
V = list()
V[['beef']] = b_price * ( w_beef + w_org*org1 + price1 )
V[['bp73']] = b_price * ( w_bp73 + w_org*org2 + price2 )
V[['bp55']] = b_price * ( w_bp55 + w_org*org3 + price3 )
V[['bbean']] = b_price * ( w_bbean + w_org*org4 + price4 )
V[['chick']] = b_price * ( w_chick + w_org*org5 + price5 )
V[['veg']] = b_price * ( w_veg + w_org*org6 + price6 )
V[['sq']] = b_price * w_sq
Number of individuals : 514
Number of observations : 3084
LL(start) : -6001.187
LL(0) : -6001.187
LL(final) : -5447.274
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
w_beef 0.0000 NA NA NA NA
w_bp73 -346.4327 Inf 0 NaN NaN
w_bp55 -228.6830 Inf 0 NaN NaN
w_bbean -449.2010 Inf 0 NaN NaN
w_chick -689.3991 Inf 0 NaN NaN
w_veg -512.5137 Inf 0 NaN NaN
w_sq -326.9425 Inf 0 NaN NaN
w_org 110.4470 Inf 0 NaN NaN
b_price 0.0027 Inf 0 NaN NaN
While the model where SQ is in preference space works fine:
V = list()
V[['beef']] = b_price * ( w_beef + w_org*org1 + price1 )
V[['bp73']] = b_price * ( w_bp73 + w_org*org2 + price2 )
V[['bp55']] = b_price * ( w_bp55 + w_org*org3 + price3 )
V[['bbean']] = b_price * ( w_bbean + w_org*org4 + price4 )
V[['chick']] = b_price * ( w_chick + w_org*org5 + price5 )
V[['veg']] = b_price * ( w_veg + w_org*org6 + price6 )
V[['sq']] = b_sq
Number of individuals : 514
Number of observations : 3084
LL(start) : -6001.187
LL(0) : -6001.187
LL(final) : -5346.365
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
w_beef 0.0000 NA NA NA NA
w_bp73 74.1530 6.5573 11.31 8.7673 8.46
w_bp55 53.6450 5.0357 10.65 7.6257 7.03
w_bbean 91.1401 7.9925 11.40 10.2998 8.85
w_chick 136.9745 11.8950 11.52 14.7182 9.31
w_veg 103.7445 8.9795 11.55 11.4234 9.08
b_sq -1.8650 0.0952 -19.60 0.1506 -12.38
w_org -25.6525 3.1062 -8.26 3.7028 -6.93
b_price -0.0153 0.0013 -12.00 0.0014
The MNL model in preference space gives:
Number of individuals : 514
Number of observations : 3084
LL(start) : -6001.187
LL(0) : -6001.187
LL(final) : -5346.362
Estimates:
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
b_beef 0.0000 NA NA NA NA
b_bp73 -1.1359 0.0605 -18.76 0.0863 -13.17
b_bp55 -0.8220 0.0545 -15.08 0.0940 -8.75
b_bbean -1.3977 0.0662 -21.11 0.0872 -16.03
b_chick -2.0971 0.0871 -24.08 0.1537 -13.64
b_veg -1.5890 0.0713 -22.28 0.1264 -12.57
b_sq -1.8711 0.0950 -19.70 0.1505 -12.44
b_org 0.3929 0.0394 9.97 0.0409 9.60
b_price -0.0154 0.0013 -12.13 0.0014 -11.05
kind regards,
Anna
Thank you very much for the quick response!
Yes, true, I meant negative lognormal distribution for the cost parameter.
The following model specification and results are with the sq-parameter in wtp-space:
V = list()
V[['beef']] = b_price * ( w_beef + w_org*org1 + price1 )
V[['bp73']] = b_price * ( w_bp73 + w_org*org2 + price2 )
V[['bp55']] = b_price * ( w_bp55 + w_org*org3 + price3 )
V[['bbean']] = b_price * ( w_bbean + w_org*org4 + price4 )
V[['chick']] = b_price * ( w_chick + w_org*org5 + price5 )
V[['veg']] = b_price * ( w_veg + w_org*org6 + price6 )
V[['sq']] = b_price * w_sq
Number of individuals : 514
Number of observations : 3084
LL(start) : -6001.187
LL(0) : -6001.187
LL(final) : -5447.274
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
w_beef 0.0000 NA NA NA NA
w_bp73 -346.4327 Inf 0 NaN NaN
w_bp55 -228.6830 Inf 0 NaN NaN
w_bbean -449.2010 Inf 0 NaN NaN
w_chick -689.3991 Inf 0 NaN NaN
w_veg -512.5137 Inf 0 NaN NaN
w_sq -326.9425 Inf 0 NaN NaN
w_org 110.4470 Inf 0 NaN NaN
b_price 0.0027 Inf 0 NaN NaN
While the model where SQ is in preference space works fine:
V = list()
V[['beef']] = b_price * ( w_beef + w_org*org1 + price1 )
V[['bp73']] = b_price * ( w_bp73 + w_org*org2 + price2 )
V[['bp55']] = b_price * ( w_bp55 + w_org*org3 + price3 )
V[['bbean']] = b_price * ( w_bbean + w_org*org4 + price4 )
V[['chick']] = b_price * ( w_chick + w_org*org5 + price5 )
V[['veg']] = b_price * ( w_veg + w_org*org6 + price6 )
V[['sq']] = b_sq
Number of individuals : 514
Number of observations : 3084
LL(start) : -6001.187
LL(0) : -6001.187
LL(final) : -5346.365
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
w_beef 0.0000 NA NA NA NA
w_bp73 74.1530 6.5573 11.31 8.7673 8.46
w_bp55 53.6450 5.0357 10.65 7.6257 7.03
w_bbean 91.1401 7.9925 11.40 10.2998 8.85
w_chick 136.9745 11.8950 11.52 14.7182 9.31
w_veg 103.7445 8.9795 11.55 11.4234 9.08
b_sq -1.8650 0.0952 -19.60 0.1506 -12.38
w_org -25.6525 3.1062 -8.26 3.7028 -6.93
b_price -0.0153 0.0013 -12.00 0.0014
The MNL model in preference space gives:
Number of individuals : 514
Number of observations : 3084
LL(start) : -6001.187
LL(0) : -6001.187
LL(final) : -5346.362
Estimates:
Estimate Std.err. t.ratio(0) Rob.std.err. Rob.t.ratio(0)
b_beef 0.0000 NA NA NA NA
b_bp73 -1.1359 0.0605 -18.76 0.0863 -13.17
b_bp55 -0.8220 0.0545 -15.08 0.0940 -8.75
b_bbean -1.3977 0.0662 -21.11 0.0872 -16.03
b_chick -2.0971 0.0871 -24.08 0.1537 -13.64
b_veg -1.5890 0.0713 -22.28 0.1264 -12.57
b_sq -1.8711 0.0950 -19.70 0.1505 -12.44
b_org 0.3929 0.0394 9.97 0.0409 9.60
b_price -0.0154 0.0013 -12.13 0.0014 -11.05
kind regards,
Anna
-
- Site Admin
- Posts: 1049
- Joined: 24 Apr 2020, 16:29
Re: wtp space
Hi Anna
for MNL, the models in preference and WTP space will give exactly the same results, and this is confirmed by your final two models. However, the model where you use has clearly run into trouble. The fit is worse and the b_price coefficient is positive. This is most likely a starting values issue. Did you start both b_price and w_sq at or near zero?
Best wishes
Stephane
for MNL, the models in preference and WTP space will give exactly the same results, and this is confirmed by your final two models. However, the model where you use
Code: Select all
V[['sq']] = b_price * w_sq
Best wishes
Stephane
-
- Posts: 6
- Joined: 27 Apr 2020, 20:01
Re: wtp space
Hello
Thanks for the suggestion. After some testing with different starting values I found tha using good starting values, close to the ratio obtained in the MNL-model, solves the problem. Now I know that there is nothing wrong with the model specification, and can move forward with RPL-specifications.
Thanks for you advice!
Anna
Thanks for the suggestion. After some testing with different starting values I found tha using good starting values, close to the ratio obtained in the MNL-model, solves the problem. Now I know that there is nothing wrong with the model specification, and can move forward with RPL-specifications.
Thanks for you advice!
Anna