# CLV (Customer Lifetime Value) operations # M:Margin, r:Retention rate, d:Discount rate M <- 100 r <- 0.9 d <- 0.1 CLV <- M*(r/(1+d-r)) CLV # CLV with initial margin CLV <- M*((1+d)/(1+d-r)) CLV # CLV with finite setting up to 5 years CLV_fin <- 0 for (i in 1:5){ CLV_year <- M*( r^i /((1+d)^i) ) CLV_fin <- CLV_fin + CLV_year #print(CLV_year) } CLV_fin # CLV with finite setting with initial margin up to 5 years CLV_fin <- 0 for (i in 0:5){ CLV_year <- M*( r^i /((1+d)^i) ) CLV_fin <- CLV_fin + CLV_year #print(CLV_year) } CLV_fin # Real case # Go to http://www.att.com/gen/investor-relations?pid=282 # Download excel file under 'Financial and Operational Results # Go to sheet 'Business Segment' and 'Business Segment 2' from the excel file # 'Business Segment' contains Revenue, Expense, and Margin # 'Business Segment 2' churn (=1-retention rate) and number of subscribers # Read in data att <- read.table("C:/R/att.txt", header=F, sep="\t") # Rename to simply names att2 <- att[,2:9] rnames <- c("rev","cost","mar","nsub","churn") rownames(att2) <- rnames colnames(att2) <- 1:8 # CLV - Infinite d <- 0.01 rev <- 1000000*att2[1,] cost <- 1000000*att2[2,] mar <- 1000000*att2[3,] nsub <- 1000*att2[4,] rr <- 1-att2[5,] #arpu <- rev/nsub CLV <- mar * rr / (1+d-rr) CLV_sub <- (mar/nsub) * rr / (1+d-rr) rownames(CLV_sub) <- "CLV per subscriber" CLV CLV_sub # CLV - Finite d <- 0.01 rev <- 1000000*att2[1,] cost <- 1000000*att2[2,] mar <- 1000000*att2[3,] nsub <- 1000*att2[4,] rr <- 1-att2[5,] #arpu <- rev/nsub CLV_fin <- 0 CLV_fin_sub <- 0 for (i in 1:12){ CLV_q <- mar*( rr^i /((1+d)^i) ) CLV_fin <- CLV_fin + CLV_q CLV_q_sub <- (mar/nsub)*( rr^i /((1+d)^i) ) CLV_fin_sub <- CLV_fin_sub + CLV_q_sub } CLV_fin_sub # Number precision, to the 323rd decimal point pre <- c(1e-322,1e-323,1e-324)