Get startedGet started for free

Intercepts and interactions

1. Intercepts and interactions

Let's talk a little bit more about some modeling details that are important and often overlooked.

2. Why no intercepts?

First, let's talk about intercepts. You might be wondering why we don't have a traditional intercept in the formula for the vs. It turns out that if we did this, we would get exactly the same probabilities for p1, p2, and p3 with and without the intercept. If you're good at algebra, you can see that if we added the same constant to v1, v2, and v3, exp(constant) is going to factor out and cancel in the probability formulae.

3. Example with an intercept

Let's look at a simple example. Here we set the intercept to 5 and compute the probabilities. Now, suppose we change the intercept to zero.

4. Example with an intercept

We get exactly the same probabilities. In statistical terms, we say the intercept is not identified. We fix it to zero by including 0 + in our model formula. If we don't do this, then mlogit() will estimate different intercepts for each alternative (except one). This is identified, but it doesn't make a lot of sense for this type of survey data. It's usually best to leave out the intercept.

5. Interactions

Another thing you should think about when fitting a choice model is whether there are interactions between the attributes. An interaction term is a new model variable created by multiplying together two of the original variables. For example, in this code, we've added an interaction between seat and price.

6. Putting interactions into formulas

While we could create this new interaction variable manually in the data frame, you can also include it in the model formula and mlogit() will do the multiplication for you. For example here is code for estimating a model with an interaction between price and trans. If you want to save some typing, you can also type trans-star-price, which means we want trans, price and the trans-price interaction in the model.

7. Interpreting interactions

If we look at the model output, we can see the interaction term at the bottom of the coefficients table. It is labeled transmanual:price and is 0-point-011. This means that buyers looking at a manual transmission are very slightly less price sensitive, but the effect is tiny. By the way, we haven't talked about the other columns in the coefficients table. Just as in linear regression, the standard error tells us how precisely we can estimate the coefficient with this data. Smaller standard errors are better. The z-value and the p-value tell us whether there is sufficient data to declare the coefficient different than zero. Our new interaction is not significantly different than zero.

8. User variables

Now, you may remember that we had a segment variable in the sportscar data with levels basic, fun and racer. You might be wondering how we could bring the segment variable into the model. We can't just put it into the utility function because it would be the same for all three alternatives and would cancel out like the intercept did. You'll get an error if you try that. But we can interact it with one of the attributes. For example, let's include an interaction between price and segment. When we look at the model coefficients, we can see that the basic segment has a price coefficient of -0-point-12, versus -0-point-14 for fun and -0-point-15 for racer. This means that the racer segment is the most price sensitive and the basic segment is the least. We should keep this interaction in the model. It tells us something important about our customers and will affect our share predictions.

9. Let's try some interactions in the chocolate data.

Whenever you are building a model, you should consider interactions. Let's try it with the chocolate data.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.