Heterogeneity in preference for other features

Choice Modeling for Marketing in R

Elea McDonnell Feit

Assistant Professor of Marketing, Drexel University

A different way to code factors

Dummy coding (what we've been doing)

  seat4 seat5
2     0     0
4     1     0
5     0     1

Effects coding (better for hierarchical models)

   seat4  seat5
2     -1     -1
4      1      0
5      0      1
Choice Modeling for Marketing in R

Changing the coding for a factor

contrasts(sportscar$seat) <- contr.sum(levels(sportscar$seat))
dimnames(contrasts(sportscar$seat))[[2]] <- levels(sportscar$seat)[1:2]
contrasts(sportscar$seat)
   4  5
2 -1 -1
4  1  0
5  0  1
Choice Modeling for Marketing in R

Making all the coefficients heterogeneous

my_rpar <- c("n", "n", "n", "n", "n")

m3 <- mlogit(choice ~ 0 + seat + trans + convert + price, data = sportscar) names(my_rpar) <- names(m3$coefficients)
my_rpar
seat4       seat5 transmanual  convertyes       price 
  "n"         "n"         "n"         "n"         "n"
m8 <- mlogit(choice ~ 0 + seat + trans + convert + price, 
             data = sportscar, 
             panel = TRUE, rpar = my_rpar)
Choice Modeling for Marketing in R

Hierarchical model parameters

m8 <- mlogit(choice ~ 0 + seat + trans + convert + price, 
              data = sportscar, 
             panel = TRUE, rpar = my_rpar)
plot(m8, par = c("seat4", "seat5")

effect coded parameter distributions

Choice Modeling for Marketing in R

Coefficient for the base level

m8$coef[1:2]
     seat4      seat5 
-0.1852167  0.3519204
-sum(m8$coef[1:2])
-0.1667037
Choice Modeling for Marketing in R

Let's try it with the `chocolate` data!

Choice Modeling for Marketing in R

Preparing Video For Download...