LoslegenKostenlos loslegen

Predicting choice shares

I've loaded a function called predict_mnl() that we can use to predict choice shares for a new set of products. predict_mnl() takes two inputs:

  • a model object produced by mlogit
  • a data frame describing the products that we want to predict shares for

Diese Übung ist Teil des Kurses

Choice Modeling for Marketing in R

Kurs anzeigen

Anleitung zur Übung

  • Inspect products to see what features these four cars have. products is not large, so you can simply type its name to print the full data frame to the console.
  • Use predict_mnl() to predict shares for those two products. You will need to set the first input to m1 and the second input to products.
  • Print the shares to the console by typing shares.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# inspect products


# use predict_mnl to predict share for products
shares <- predict_mnl(___, ___)

# print the shares to the console
Code bearbeiten und ausführen