Hi all,
Working so far with different shelf software, socio-demog, and LVs could only be included as interaction vars (with one of the attributes) since there is no variation in these vars within respondents. However looking at the examples in Apollo manual (e.g. the spinal Surgery study or the NHS acute hospitals one), it seems that both can be introduced as 'stand-alone' variables, or as interacting with the ASCs.
In the latter case, is it correct to include LV as: Lambda_LV* LV rather than define the ASC as, for example: asc_bus= asc_ALT_base+Lambda_LV*LV
Also, do the same socio-demos that appear in the LV structural model need to be included also in the choice model (but not the other way around)?
Best,
Anat
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.
Introducing socio-demog and LVs in MMNL
Introducing socio-demog and LVs in MMNL
Anat Tchetchik
Re: Introducing socio-demog and LVs in MMNL
Hi Anat,
Unlike other software, Apollo provides the user with full freedom to define the utility functions. This increased freedom, however, also means that it is the user's responsibility to make sure the model is identifiable.
Let's imagine you have a model with three alternatives: A, B, and C, each with the following deterministic utility functions:
Where x1_j is the value of explanatory variable x1 for alternative j, asc_j are alternative specific constants, and b1 is a preference parameter to be estimated.
Now let's imagine you want to include a characteristic of the respondent as an additional explanatory variable, lets' call this new variable z. Note that z does not change across alternatives (because it is associated to the respondent). You have two ways of including this variable.
The first approach is by interacting it with a variable that does change across alternatives. In this case, we could interact it with x1 as follows:
In this case, b2 will measure how the influence of x1 changes due to the value of z.
A second approach is including z directly as a new explanatory variable in J-1 alternatives (where J is the number of alternatives), using different coefficients in each alternative. In our case, we could include two alternatives. It doesn't matter which alternative we exclude z from, as that will become our reference. The utilities would look as follows.
In this case, b3 measures the impact of z on the utility of B with respect to the utility of A; and b4 measures the impact of z on the utility of C, with respect to the utility of A. For example, if b3>0 it means that respondents for whom z>0 have a higher probability of choosing alternative B than alternative A ceteris paribus.
Notice that z can be a latent variable associated to the respondent (e.g. risk aversion, attitude towards recycling, etc.).
Also notice that doing
Is equivalent to doing:
Best wishes
David
Unlike other software, Apollo provides the user with full freedom to define the utility functions. This increased freedom, however, also means that it is the user's responsibility to make sure the model is identifiable.
Let's imagine you have a model with three alternatives: A, B, and C, each with the following deterministic utility functions:
Code: Select all
V[["A"]] = asc_A + b1*x1_A
V[["B"]] = asc_B + b1*x1_B
V[["C"]] = asc_C + b1*x1_C
Now let's imagine you want to include a characteristic of the respondent as an additional explanatory variable, lets' call this new variable z. Note that z does not change across alternatives (because it is associated to the respondent). You have two ways of including this variable.
The first approach is by interacting it with a variable that does change across alternatives. In this case, we could interact it with x1 as follows:
Code: Select all
V[["A"]] = asc_A + b1*x1_A + b2*x1_A*z
V[["B"]] = asc_B + b1*x1_B + b2*x1_B*z
V[["C"]] = asc_C + b1*x1_C + b2*x1_B*z
A second approach is including z directly as a new explanatory variable in J-1 alternatives (where J is the number of alternatives), using different coefficients in each alternative. In our case, we could include two alternatives. It doesn't matter which alternative we exclude z from, as that will become our reference. The utilities would look as follows.
Code: Select all
V[["A"]] = asc_A + b1*x1_A
V[["B"]] = asc_B + b1*x1_B + b3*z
V[["C"]] = asc_C + b1*x1_C + b4*z
Notice that z can be a latent variable associated to the respondent (e.g. risk aversion, attitude towards recycling, etc.).
Also notice that doing
Code: Select all
V[["B"]] = asc_B + b1*x1_B + b3*z
Code: Select all
asc_B = asc_B_base + b3*z
V[["B"]] = asc_B + b1*x1_B
David
Re: Introducing socio-demog and LVs in MMNL
Dear David, Thanks a million for this step-by-step explanation, this flexibility is very useful!
Anat Tchetchik