yrs_calc: Calculate license buying

Description Usage Arguments Functions See Also Examples

Description

Functions to calculate retention for modelling with retain or renew methods. These should only be run after preparation using yrs_zero_split

Usage

1
2
3
4
5
yrs_calc_renew(history_split)

yrs_calc_renew_one(history_split, year0)

yrs_calc_retain(history_split, ...)

Arguments

history_split

license history list produced by yrs_zero_split()

year0

year for defining customers for whom retention will be calculated

...

optional grouping variables

Functions

See Also

Other functions to estimate annual license buying: yrs_avidity, yrs_calc_avg, yrs_fit, yrs_lifetime, yrs_plot, yrs_predict_avg, yrs_predict, yrs_result, yrs_zero

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(dplyr)
data(all_sports)
df_split <- yrs_zero_split(all_sports) %>%
   yrs_zero_filter(function(x) filter(x, age_year %in% 30:50))

yrs_calc_renew_one(df_split, 2008)
yrs_calc_renew(df_split)
yrs_calc_retain(df_split)

library(ggplot2)
retain <- yrs_calc_retain(df_split, year0)
ggplot(retain, aes(years_since, pct, color = year0, size = n0)) +
    geom_point() +
    ggtitle("We see some variation in retention curves depending on year zero",
            "more distant future years (years_since) have fewer observations")

southwick-associates/lifetime documentation built on Feb. 24, 2020, 9:33 a.m.