Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save sbalci/1b33200e07c7e8bcc4f64f10bef3a80b to your computer and use it in GitHub Desktop.

Select an option

Save sbalci/1b33200e07c7e8bcc4f64f10bef3a80b to your computer and use it in GitHub Desktop.
# https://stackoverflow.com/questions/43419385/how-to-export-survfit-output-as-a-csv-table
res <- summary(km_fit, times = c(12,36,60))
save.df <- as.data.frame(res[c("strata", "time", "n.risk", "n.event", "surv", "std.err", "lower", "upper")])
# write.csv(save.df, file = "./file.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment