Since the global average of each sale is $2128 and the cost is $2500 for each person(cost of sales effots). We would expect them to lose $372000.((2500-2128)*1000)
According to Figure 5.13 if the firm wants the average profit to at least double the sales effort costs then it should should not go down the ranked list past the 100th entry.(include 1st decile)
If we want the cutoff to be at $2500 then we pick the mean response to be above 1.174812 (2500/2128). In this case that means we stop at the 6th decile (it looks like that is a little more than 1.17) or proceed down the ranked leads up to the 60th record.
This two-stage process approach lets us use the model to maximize the likelihood of getting an outcome that we desire and allows us to easily determine what our cutoff should be depending on the scenario. While developing a model only takes in data and spits out a number, It doesn’t tell us much about how that number compared to the rest of the records.
a <- c(0.03, 0, # just copied table 5.7 and did some manipulations
0.52, 0,
0.38, 0,
0.82, 1,
0.33, 0,
0.42, 0,
0.55, 1,
0.59, 0,
0.09, 0,
0.21, 0,
0.43, 0,
0.04, 0,
0.08, 0,
0.13, 0,
0.01, 0,
0.79, 1,
0.42, 0,
0.29, 0,
0.08, 0,
0.02, 0)
b <- a[2*(1:20)]
c <- data.frame(prob=a[seq(from=1,to=40,by=2)],
actual = b)
df <- c[order(-c$prob),] #show in descending order
print(df, row.names = FALSE) #get rid of that id column
prob actual
0.82 1
0.79 1
0.59 0
0.55 1
0.52 0
0.43 0
0.42 0
0.42 0
0.38 0
0.33 0
0.29 0
0.21 0
0.13 0
0.09 0
0.08 0
0.08 0
0.04 0
0.03 0
0.02 0
0.01 0
For the cutoff of 0.25 (that is if Propensity(1)>.25 -> belongs to group 1)
| predict/actual | 1 | 0 |
|---|---|---|
| 1 | 3 | 8 |
| 0 | 0 | 9 |
For the cutoff of 0.5 (that is if Propensity(1)>.5 -> belongs to group 1)
| predict/actual | 1 | 0 |
|---|---|---|
| 1 | 3 | 2 |
| 0 | 0 | 15 |
For the cutoff of 0.75 (that is if Propensity(1)>.75 -> belongs to group 1)
| predict/actual | 1 | 0 |
|---|---|---|
| 1 | 2 | 0 |
| 0 | 1 | 18 |
gain <- gains::gains(df$actual, df$prob)
barplot(gain$mean.resp / mean(df$actual),
names.arg = gain$depth,
xlab = "Percentile",
ylab = "Mean Response",
main = "Decile-wise lift chart")