View source: R/ca_SRM_time_varying.R
ca_SRM_time_varying | R Documentation |
Time varying Simple retention model Estimates retention rate using logistic regression and the simple regression model Mostly used for contractual models where there are clear opportunities for cancellation. Could be used in non-contractional situations although the cancellation opportunities should be defined. Not recommended for use with services that consumers use rotating-door style. Use the migration model there.
ca_SRM_time_varying(df_logistic, reference_level = 12, maxT = 12)
df_logistic |
A data frame, formatted for logistic regression. 1 row for each customer id/timeperiod. 1/0 for purchase. |
reference_level |
All coefficients will be judged relevant to the reference level. It defaults to time period 12. (Note interpretation will change based on how T is formulated.) |
maxT |
The number of timeperiods to build. |
Returns logistic model results (the glm model)
library(stats)
x <- c(3, 1, 5)
df_logistic <- bigT_expand_via_apply(x)
model <- ca_SRM_time_varying(df_logistic, reference_level = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.