Skip to content

Instantly share code, notes, and snippets.

@philippbayer
Created July 14, 2016 13:34
Show Gist options
  • Select an option

  • Save philippbayer/57c15a44c257bea3986e6599bde7940d to your computer and use it in GitHub Desktop.

Select an option

Save philippbayer/57c15a44c257bea3986e6599bde7940d to your computer and use it in GitHub Desktop.
library(survival)
# to make the survobj (source: https://rstudio-pubs-static.s3.amazonaws.com/5588_72eb65bfbe0a4cb7b655d2eee0751584.html )
a = read.table("table2.csv",stringsAsFactors=F,sep=",")
a$survObj <- with(a, Surv(time, status == 1))
km <- survfit(survObj ~ 1, data = a, conf.type = "log-log")
plot(km)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment