Price as a factor
As I mentioned in the last video, you can treat price as a factor. Let's estimate a model like that. The chocolate
data is already loaded.
Diese Übung ist Teil des Kurses
Choice Modeling for Marketing in R
Anleitung zur Übung
- Change the
Price
variable to a factor in thechocolate
data. - Call
mlogit
to fit a model with the formulaSelection ~ 0 + Brand + Type + Price
with the chocolate data and assign it tochoc_m3
. - Use
summary()
to inspect the model coefficients.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# change the Price variable to a factor in the chocolate data
# fit a model with mlogit and assign it to choc_m3
# inspect the coefficients