These functions can be called following make_history with show_diagnostics = TRUE.

  • history_check_sample: View a sample of customers from history table to check year over year dynamics (outputs a list split by customer ID).

  • history_check_lapse: Produce a count summary of customers by lapse value (outputs a list).

  • history_check_R3: Produce a count summary of customers by R3, yrs_since, & duration_run_lag (outputs a data frame).

history_check_sample(history, n_samp = 3, buy_min = 3, buy_max = 8)

history_check_R3(history, yrs)

history_check_lapse(history)

Arguments

history

data frame: license history table

n_samp

numeric: number of customers to view

buy_min

numeric: minimum number of license purchases for customers to include

buy_max

numeric: maximum number of license purchases for customers to include

yrs

numeric: Years in sales data (column 'year') from which to create license history

See also

Salic Function Reference: salic

Other license history functions: make_history, rank_sale

Examples

library(dplyr) data(sale, lic) yrs <- 2008:2018 history <- inner_join(lic, sale) %>% rank_sale() %>% make_history(yrs, "res", show_diagnostics = TRUE)
#> Joining, by = "lic_id"
history_check_sample(history)
#> $`5289` #> cust_id year res duration_run lapse R3 #> 4 5289 2010 1 1 1 NA #> 5 5289 2012 1 1 0 NA #> 6 5289 2013 1 1 0 2 #> 7 5289 2014 1 1 0 2 #> 8 5289 2015 1 1 0 2 #> 9 5289 2016 1 1 0 2 #> 10 5289 2017 1 1 0 2 #> 11 5289 2018 1 1 NA 2 #> #> $`21116` #> cust_id year res duration_run lapse R3 #> 1 21116 2016 0 1 0 4 #> 2 21116 2017 0 1 0 2 #> 3 21116 2018 0 1 NA 2 #> #> $`29045` #> cust_id year res duration_run lapse R3 #> 12 29045 2011 1 1 0 NA #> 13 29045 2012 1 1 0 NA #> 14 29045 2013 1 1 1 2 #>
history_check_lapse(history)
#> $`A. Next time held: 1yr (i.e., renewed)` #> lapse year n #> 1 0 2008 3860 #> 2 0 2009 4361 #> 3 0 2010 4438 #> 4 0 2011 4691 #> 5 0 2012 4947 #> 6 0 2013 5191 #> 7 0 2014 5288 #> 8 0 2015 5244 #> 9 0 2016 5406 #> 10 0 2017 5534 #> #> $`B. Next time held: >1yr/never (i.e., lapsed)` #> lapse year n #> 11 1 2008 2533 #> 12 1 2009 3230 #> 13 1 2010 3337 #> 14 1 2011 3128 #> 15 1 2012 3296 #> 16 1 2013 3082 #> 17 1 2014 3682 #> 18 1 2015 3842 #> 19 1 2016 3755 #> 20 1 2017 3855 #> #> $`C. Next time held: unknown` #> lapse year n #> 21 NA 2018 9206 #>
history_check_R3(history, 2008:2018)
#> R3 R3_label yrs_since duration_run_lag n #> 1 1 Carry 1 2 1685 #> 2 1 Carry 1 3 1844 #> 3 1 Carry 1 90 155 #> 4 1 Carry 1 91 252 #> 5 1 Carry 1 92 369 #> 6 1 Carry 1 93 519 #> 7 1 Carry 1 94 709 #> 8 1 Carry 1 95 892 #> 9 1 Carry 1 96 932 #> 10 1 Carry 1 97 982 #> 11 1 Carry 1 98 1055 #> 12 1 Carry 1 99 1082 #> 13 2 Renew 1 1 21134 #> 14 3 Reactivate 2 0 5073 #> 15 3 Reactivate 3 -1 2021 #> 16 3 Reactivate 4 -2 1144 #> 17 3 Reactivate 5 -3 703 #> 18 4 Recruit 6 -4 405 #> 19 4 Recruit 7 -5 269 #> 20 4 Recruit 8 -6 169 #> 21 4 Recruit 9 -7 65 #> 22 4 Recruit 10 -8 30 #> 23 4 Recruit NA NA 12596