Interaction between brand and type
The chocolate data is loaded as a dfidx object and ready to go. Feel free to inspect it to refresh your memory. Once you've done that, you are going to fit a model with an interaction between Brand and Type.
This exercise is part of the course
Choice Modeling for Marketing in R
Exercise instructions
- Add a formula to the
mlogit()command for a model withBrand,Type,Price, and the interaction betweenBrandandType. Remember that theSelectioncolumn contains the observed choice and don't forget to leave out the intercept. - Summarize
choc_m4to see its model coefficients.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# add the formula for mlogit
choc_m4 <- mlogit(___, data=chocolate)
# use summary to see the coefficients