Important: Read this before posting to this forum

  1. 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.
  2. 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
  3. Before asking a question on the forum, users are kindly requested to follow these steps:
    1. Check that the same issue has not already been addressed in the forum - there is a search tool.
    2. 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
    3. Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
    4. Make sure that R is using the latest official release of Apollo.
  4. If the above steps do not resolve the issue, then users should follow these steps when posting a question:
    1. provide full details on the issue, including the entire code and output, including any error messages
    2. 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

Ask questions about model specifications. Ideally include a mathematical explanation of your proposed model.
Post Reply
manes
Posts: 16
Joined: 15 Jun 2023, 13:13
Location: Israel
Contact:

Introducing socio-demog and LVs in MMNL

Post by manes »

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
Anat Tchetchik
dpalma
Posts: 190
Joined: 24 Apr 2020, 17:54

Re: Introducing socio-demog and LVs in MMNL

Post by dpalma »

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:

Code: Select all

V[["A"]] = asc_A + b1*x1_A
V[["B"]] = asc_B + b1*x1_B
V[["C"]] = asc_C + b1*x1_C
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:

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
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.

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
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

Code: Select all

V[["B"]] = asc_B + b1*x1_B + b3*z
Is equivalent to doing:

Code: Select all

asc_B = asc_B_base + b3*z
V[["B"]] = asc_B + b1*x1_B
Best wishes
David
manes
Posts: 16
Joined: 15 Jun 2023, 13:13
Location: Israel
Contact:

Re: Introducing socio-demog and LVs in MMNL

Post by manes »

Dear David, Thanks a million for this step-by-step explanation, this flexibility is very useful!
Anat Tchetchik
Post Reply