Skip to content

Instantly share code, notes, and snippets.

@daynebatten
Created December 23, 2015 14:29
Show Gist options
  • Save daynebatten/d5a143559b863ff5edb6 to your computer and use it in GitHub Desktop.
Save daynebatten/d5a143559b863ff5edb6 to your computer and use it in GitHub Desktop.
# Generate a survival fit using our cox results and imaginary customers
plot_fit <- survfit(fit, newdata = new_values, id = id)
# Plot the results!
plot(plot_fit, mark.time = FALSE, col = c('red', 'blue'), ylim = c(.6, 1), xlab = 'Days Since Signing Up', ylab = 'Percent Surviving')
legend(25, .8, legend = c('Contacted Support at Day 500', 'Never Contacted Support'), col = c('red', 'blue'), lty = c(1, 1))
title('Support Interactions and Churn')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment