Merge branch 'plots-per-dx'
* plots-per-dx: survival: Add plots per diagnosis
This commit is contained in:
commit
5c26e4100e
20
survival.R
20
survival.R
@ -57,6 +57,24 @@ sma_plot_surv_asct_sex <- function() {
|
|||||||
pval = TRUE)
|
pval = TRUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# plot survival after diagnosis per diagnosis
|
||||||
|
sma_plot_surv_dx_dx <- function() {
|
||||||
|
ggsurvplot(survfit(surv_dx ~ diagnosis, data = secmal), data = secmal,
|
||||||
|
xscale = "d_y", title = "Survival after diagnosis",
|
||||||
|
break.time.by = sma_break.time.by,
|
||||||
|
risk.table = "abs_pct",
|
||||||
|
ggtheme = theme_bw())
|
||||||
|
}
|
||||||
|
|
||||||
|
# plot survival after diagnosis per diagnosis
|
||||||
|
sma_plot_surv_asct_dx <- function() {
|
||||||
|
ggsurvplot(survfit(surv_asct ~ diagnosis, data = secmal), data = secmal,
|
||||||
|
xscale = "d_y", title = "Survival after transplantation",
|
||||||
|
break.time.by = sma_break.time.by,
|
||||||
|
risk.table = "abs_pct",
|
||||||
|
ggtheme = theme_bw())
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Write survival plots to files
|
# Write survival plots to files
|
||||||
#
|
#
|
||||||
@ -65,4 +83,6 @@ sma_plot_file_surv <- function() {
|
|||||||
sma_plot_file("survival_dx_sex.png", png, sma_plot_surv_dx_sex)
|
sma_plot_file("survival_dx_sex.png", png, sma_plot_surv_dx_sex)
|
||||||
sma_plot_file("survival_asct.png", png, sma_plot_surv_asct)
|
sma_plot_file("survival_asct.png", png, sma_plot_surv_asct)
|
||||||
sma_plot_file("survival_asct_sex.png", png, sma_plot_surv_asct_sex)
|
sma_plot_file("survival_asct_sex.png", png, sma_plot_surv_asct_sex)
|
||||||
|
sma_plot_file("survival_dx_dx.png", png, sma_plot_surv_dx_dx)
|
||||||
|
sma_plot_file("survival_asct_dx.png", png, sma_plot_surv_asct_dx)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user