Predicting shares

Choice Modeling for Marketing in R

Elea McDonnell Feit

Assistant Professor of Marketing, Drexel University

Multinomial logit model

v1 <- alpha * seat1 + beta * price1
v2 <- alpha * seat2 + beta * price2
v3 <- alpha * seat3 + beta * price3

p1 <- exp(v1) / ( exp(v1) + exp(v2) + exp(v3) ) p2 <- exp(v2) / ( exp(v1) + exp(v2) + exp(v3) ) p3 <- exp(v3) / ( exp(v1) + exp(v2) + exp(v3) )
Choice Modeling for Marketing in R

Data frame for new products

price <- c(35, 30)

seat <- factor(c(2, 2), levels = c(2,4,5)) trans <- factor(c("manual", "auto"), levels = c("auto", "manual")) convert <- factor(c("no", "no"), levels = c("no", "yes"))
segment <- factor(c("basic", "basic"), levels = c("basic", "fun", "racer"))
prod <- data.frame(seat, trans, convert, price, segment) prod
  seat  trans convert price segment
1    2 manual      no    35     basic
2    2   auto      no    30     basic
Choice Modeling for Marketing in R
m5 <- mlogit(choice ~ 0 + seat + convert + trans + price:segment, 
             data = sportscar)

prod.coded <- model.matrix(update(m5$formula, 0 ~ .), data = prod)[, -1] prod.coded
  seat4 seat5 convertyes transmanual price:segmentbasic
1     0     0          0           1                 35
2     0     0          0           0                 30
  price:segmentfun price:segmentracer
1                0                  0
2                0                  0
v <- prod.coded %*% m5$coef
v
       [,1]
1 -9.217304
2 -6.847354
Choice Modeling for Marketing in R

Code for predicting shares

p <- exp(v) / sum(exp(v))
cbind(p, prod)
           p seat  trans convert price segment
1 0.08549309    2 manual      no    35   basic
2 0.91450691    2   auto      no    30   basic
Choice Modeling for Marketing in R

A function for share prediction

predict_mnl <- function(model, products) {
  data.model <- model.matrix(update(model$formula, 0 ~ .), 
                             data = products)[, -1]
  utility <- data.model %*% model$coef
  share <- exp(utility) / sum(exp(utility))
  cbind(share, products)
}
Choice Modeling for Marketing in R

Plotting shares

shares <- predict_mnl(m5, products)

barplot(shares$share, horiz = TRUE, col = "tomato2", xlab = "Predicted Market Share", names.arg = c("Our Sportscar", "Competitor 1"))

Share Prediction

Choice Modeling for Marketing in R

Let's predict some shares for sports cars and chocolate bars!

Choice Modeling for Marketing in R

Preparing Video For Download...