Open mavershang opened 2 years ago
You can easily calculate it yourself with the survdiff
function:
library('survival')
library('tidyverse')
library('survminer')
fit <- survfit( Surv(time, status) ~ sex, data = colon )
ggsurvplot_facet(fit, colon, facet.by = c('rx', 'perfor'),
pval = TRUE,
ggtheme = theme_grey())
# to reproduce the p-value in the upper left and the upper right:
survdiff(Surv(time, status) ~ sex,
data = colon, subset = perfor == 0 & rx == 'Obs')$pvalue
survdiff(Surv(time, status) ~ sex,
data = colon, subset = perfor == 1 & rx == 'Obs')$pvalue
Hello, I have a simple question: in using survminer::ggsurvplot_facet function, how can I get the p-value calculcated per each facet? It's displayed on the plot, but I just want to save it for other analysis. Thanks.