Session Ready
Exercise

Predicting shares for chocolates

A store wants to carry a line of chocolates that is in a data frame I've already loaded called choc_line. I've already effects coded it and stored the code model matrix in choc_line_coded. In this stepped exercise, you will fill in the key elements of the code for computing shares for choc_line from the hierarchical model choc_m8.

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4

First, we are going to obtain the mean coefficients for all users from the model object. These are stored in the first 9 elements of coef(choc_m8). Assign them to coef_means so that we can use them later.