1. Learn
  2. /
  3. Courses
  4. /
  5. Choice Modeling for Marketing in R

Exercise

What types of chocolate do people choose?

The chocolate data has been loaded in long format with one row for each alternative in each observed choice. Remember that the Type, Brand and Price describe each alternative and the Selection variable tells us what the respondent chose. Let's use xtabs() to find out how often people choose each type of chocolate.

Instructions 1/2

undefined XP
  • 1
    • Fill in the formula with Type and Selection.
    • Tell xtabs to use the data frame called chocolate.
  • 2
    • Modify the code to look at the choice counts for each Brand.
    • Look at the plot to find the least popular Brand.