Created
February 14, 2015 15:13
-
-
Save daynebatten/542caa54a18207662d59 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
# Load the survival library | |
library(survival) | |
# Read in the data and create a "survival object" | |
netlixx_cox <- read.csv('C:/Users/dayne/Desktop/NetLixxCox.csv') | |
netlixx_cox$survival <- Surv(netlixx_cox$followtime, netlixx_cox$churn == 1) | |
# Run a cox regression of survival on female, age, and coupon status | |
results <- coxph(survival ~ female + age + coupon, data = netlixx_cox) | |
# View the results! | |
results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment