Skip to content

Instantly share code, notes, and snippets.

@tonebeta
Created October 5, 2018 15:35
Show Gist options
  • Save tonebeta/32c5ca74b465c9cba119f4c7b5ca7fed to your computer and use it in GitHub Desktop.
Save tonebeta/32c5ca74b465c9cba119f4c7b5ca7fed to your computer and use it in GitHub Desktop.
dt<- read_csv("C:/Users/tonebeta/Desktop/O68_Gastrointestinal_bleeding.csv")
dt$PATIENTID <- NULL
vars = names(dt)
vars = setdiff(vars, c("GROUPNAME","DURATION","STATUS"))
dt[vars] <- lapply(dt[vars],factor)
Cox_model = coxph(Surv(dt$DURATION,dt$STATUS) ~ . ,data=dt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment