Created
February 20, 2018 15:24
-
-
Save tvladeck/a7eb353fef802697c7ac49be3cba142b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We simulate draws from two different timing distributions representing different processes | |
payment_failures <- rexp(1000, rate = 1/90) | |
intentional_churn <- rexp(1000, rate = 1/120) | |
### proportion of payment failures to intentional churn at 90 day cutoff | |
pf_90 <- (payment_failures < 90) %>% sum | |
if_90 <- (intentional_churn < 90) %>% sum | |
pf_90 / (if_90 + pf_90) | |
# 0.5430061 | |
### proportion of payment failures to intentional churn at 60 day cutoff | |
pf_60 <- (payment_failures < 60) %>% sum | |
if_60 <- (intentional_churn < 60) %>% sum | |
pf_60 / (if_60 + pf_60) | |
# 0.5417633 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment