简体   繁体   English

R中有没有办法按年绘制生存曲线?

[英]Is there a way in R to plot a survival curve by year?

good morning.早上好。 I am thinking is it possible to extract data and draw several survival curves by years in the R?我在想是否可以在 R 中提取数据并按年绘制几条生存曲线? For example, is it possible to plot a survival curve which represents each year from a single spreadsheet file?例如,是否可以从单个电子表格文件中绘制代表每年的生存曲线? Many thanks in advance for helping me with this.非常感谢您在此帮助我。

Yes, take a look at this link: https://cran.r-project.org/web/packages/survminer/vignettes/Informative_Survival_Plots.html是的,看看这个链接: https ://cran.r-project.org/web/packages/survminer/vignettes/Informative_Survival_Plots.html

Basically, you'll want to create a regression equation where year is one of the independent variables, then when you plot you will get multiple series, one for each year.基本上,您需要创建一个回归方程,其中年份是自变量之一,然后当您绘制时,您将获得多个系列,每年一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM