Closed for8ver3 closed 1 year ago
Thanks for the post @for8ver3
Can you please update your post with an example for calculating this p-value I can run on my machine (both data and code), aka a reprex. Please don't include from ggsurvplot if this is a p-value that can be calculated using the survival package, for example.
Hi @for8ver3 , please feel free to re-open this issue when you have time.
Hi @ddsjoberg , sorry. Now that I have learnt to use reprex...please see output below.
library(reprex)
library(survminer)
#> Loading required package: ggplot2
#> Loading required package: ggpubr
library(survival)
#>
#> Attaching package: 'survival'
#> The following object is masked from 'package:survminer':
#>
#> myeloma
library(ggsurvfit)
data("df_lung")
fit2 <- survfit(Surv(time, status) ~ ph.ecog, df_lung)
ggsurvplot(fit2, df_lung,
risk.table = TRUE,
tables.y.text = F,
legend = "none",
pval = TRUE,
test.for.trend = TRUE)
ggsurvplot(fit2, df_lung,
risk.table = TRUE,
tables.y.text = F,
legend = "none",
pval = TRUE,
test.for.trend = FALSE)
Created on 2023-08-08 with reprex v2.0.2
Please don't include from ggsurvplot
I'll need more details on how this p-value is calculated.
suggest with add_pvalue(), add an option to get p-value for trend. Similar to the ggsurvplot: test.for.trend
Thanks kindly