Last active
January 6, 2016 19:40
-
-
Save daynebatten/9a8216f69cd9dca0682e 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/google drive/laptop files/personal/time dependent coefficients/tdc_data.csv') | |
# Fit a cox model of a survival object on the user's gender | |
fit <- coxph(Surv(time, churn) ~ male, 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