Fitting a choice model
Next, you will estimate a choice model using the mlogit() function from the mlogit package with the data in sportscar. The data has already been loaded. The process is very similar to fitting a regression model with lm().
This exercise is part of the course
Choice Modeling for Marketing in R
Exercise instructions
- Load the
mlogitpackage usinglibrary(). - Fit a model to predict
choiceas a function ofseat,trans,convertandprice. You will need to fill in the formula input. - Summarize the
m1object.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# load the mlogit library
# fit a choice model using mlogit() and assign the output to m1
m1 <- mlogit(___ ~ ___, data=sportscar)
# summarize the m1 object to see the output of the choice model