生存分析surminer包
--- title: "surminer" output: html_document --- #生存分析 ```{r} #参考http://www.sthda.com/english/wiki/survminer-r-package-survival-data-analysis-and-visualization library("survival") library("survminer") ``` #Draw survival curves without grouping ```{r} # Fit survival curves fit <- survfit(Surv(time, status) ~ 1, data = lung) # Drawing curves ggsurvplot(fit, color = "#2E9FDF") ``` #Draw survival curves with two groups ```{r} # Fit survival curves fit<- survfit(Surv(time, status) ~ sex, data = lung) # Drawing survival curves ggsurvplot(fit) ``` #Change font size, style and color ```{r} # Change font style, size and color # Change only font size ggsurvplot(fit, main = "Survival curve", font.main = 18, font.x = 16, font.y = 16, font.tickslab = 14) # Change font size, style and color at the same time ggsurvplot(fit, main = "Survival curve", font.main = c(16, "bold&