Predicting shares with hierarchical models

Choice Modeling for Marketing in R

Elea McDonnell Feit

Assistant Professor of Marketing, Drexel University

Hierarchical model with correlations

m10 <- mlogit(choice ~ 0 + seat + trans + convert + price, 
              data = sportscar, 
              rpar = myrpar, panel = TRUE, correlation = TRUE)

cor.mlogit(m10)
                 seat4      seat5 transmanual convertyes      price
seat4        1.0000000 -0.3411867   0.1584436 -0.3129433  0.1551497
seat5       -0.3411867  1.0000000  -0.1124484  0.1187094 -0.3206838
transmanual  0.1584436 -0.1124484   1.0000000 -0.6231883  0.7710748
convertyes  -0.3129433  0.1187094  -0.6231883  1.0000000 -0.1165536
price        0.1551497 -0.3206838   0.7710748 -0.1165536  1.0000000
Choice Modeling for Marketing in R

Products we want to predict shares for

prod
  seat  trans convert price 
1    2 manual      no    35 
2    2   auto      no    30
prod.coded
  seat4 seat5 transmanual convertyes price
1    -1    -1           1          0    35
2    -1    -1           0          0    30
Choice Modeling for Marketing in R

Share prediction for hierarchical model

mean <- m10$coef[1:5]   # Hard coded
Sigma <- cov.mlogit(m10)

share <- matrix(NA, nrow = 1000, ncol = nrow(prod.coded)) for (i in 1:1000) {
coef <- mvrnorm(1, mu = mean, Sigma = Sigma)
utility <- prod.coded %*% coef
share[i,] <- exp(utility) / sum(exp(utility))
}
cbind(colMeans(share), prod)
  colMeans(share) seat  trans convert price segment
1       0.1238315    2 manual      no    35   basic
2       0.8761685    2   auto      no    30   basic
Choice Modeling for Marketing in R

Let's practice!

Choice Modeling for Marketing in R

Preparing Video For Download...