Created
December 23, 2015 14:13
-
-
Save daynebatten/e7b2e539e64407665876 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Load the survival package | |
library(survival) | |
# Read in the CSV | |
data <- read.csv('C:/users/dbatten/desktop/time_varying_covariate.csv') | |
# Fit a cox model of a survival object on whether or not the user contacted support | |
fit <- coxph(Surv(start_time, end_time, churned) ~ contacted_support, data = data) | |
# Have a gander at the results | |
summary(fit) | |
# Make sure we haven't violated the proportional hazards assumption | |
cox.zph(fit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment