Hi I am estimating a model with lognormal cost and want to use the preference of space.
1. First I estimated the same model in preference of space and WTP space to compare the estimates. I assumed a lognormal distribution for cot: randcoeff[["log_cost" ]] =exp(mu_log_cost + sigma_log_cost * draws_log_cost) .
I estimated the mean WTP (Battr/exp(mu_logcost+s/2)) and median MWTP (Battr/exp(mu_logcost)) in pref space. For instance, for the first attribute are 10.32 and 24.69, respectively. I also estimated the wtp space model, and the meanWTP obtained directly in the WTP space model is 27.12.
As you can see working with medians in this case is more informative as my wtp distribution is skewed.
2. Then I estimated the conditional estimates using apollo_conditionals.
I went ahead and applied the same formulas explained before with my conditional parameters for each individual but found that both the mean and the median the estimates were very different. The conditinal wtps have two digits and the unconditional wtps have one digit (i.e. medianMwtp for attr 1 is 24.69 compared to the conditional medianMWTP for attribute 1 is 2.38).
This made me think that maybe “Apollo_conditional()” formula is already making the transformation of the lognormal cost coefficient and the parameter it gives you as the output is already transformed (is mu_cost), so it does not need to be transformed anymore (as it is not mu_logcost).
I made a quick test using wtp= coditionaBattr/condBcost to estimate the conditional wtps and I get numbers that are much more very similar to my original “unconditional estimates”. (i.e. medianMwtp for attr 1 is 24.69 and the mean of conditionalMWTP for attribute 1 is 29.85.
So to confirm this, my question is, does “Apollo_conditional()” output gives you the mu_cost estimate or the mu_logcost estimate?
3. Assuming that I am right and that I can use the conditional cost estimates directly to calculate WTPs without doing any transformation of the cost parameter (using wtp= coditionaBattr/condBcost ). How would I go to estimate the obtain the median conditional WTP ?
Is there a way to change the Apollo_conditional() code to give you medians rather than the means of the cost parameters?
Thanks for your clarification and help!
Kind regards
Valeria Toledo
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.
 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.
estimating conditional medianWTP with a lognormalcost estimates

 Posts: 10
 Joined: 20 Aug 2020, 15:20
Re: estimating conditional medianWTP with a lognormalcost estimates
Hi Valeria,
Concerning your first question: yes, apollo_conditionals returns the mean and standard deviation of the random coefficient itself, including any tranformation you might have done inside apollo_randCoeff. So in your case the mean and standard deviation of the lognormal, not the underlying normal. In your notation, it returns the mean of log_cost, what you seem to call mu_cost.
Concerning your second question: no, apollo_conditionals cannot return the median of the individual posteriors. However, you may be able to calculate the median using the procedure described in another of your posts: viewtopic.php?f=16&t=273&p=890#p890
Cheers
David
Concerning your first question: yes, apollo_conditionals returns the mean and standard deviation of the random coefficient itself, including any tranformation you might have done inside apollo_randCoeff. So in your case the mean and standard deviation of the lognormal, not the underlying normal. In your notation, it returns the mean of log_cost, what you seem to call mu_cost.
Concerning your second question: no, apollo_conditionals cannot return the median of the individual posteriors. However, you may be able to calculate the median using the procedure described in another of your posts: viewtopic.php?f=16&t=273&p=890#p890
Cheers
David

 Posts: 10
 Joined: 20 Aug 2020, 15:20
Re: estimating conditional medianWTP with a lognormalcost estimates
Dear David ,
Thanks the clarification and suggestion to estimate the means. I will see if I have luck with that.
Kind regards
Valeria Toledo
Thanks the clarification and suggestion to estimate the means. I will see if I have luck with that.
Kind regards
Valeria Toledo