pharmaverse / ggsurvfit

http://www.danieldsjoberg.com/ggsurvfit/
Other
67 stars 19 forks source link

Feature request: Implementing other tests for p-value #217

Open spiralparagon opened 2 weeks ago

spiralparagon commented 2 weeks ago

I'm curious if other tests such as weighted log-rank, generalized Wilcoxon, Peto-Peto m.m. can be implemented in the add_p function similar to ggsurvplot. A reference for example: https://rpkgs.datanovia.com/survminer/articles/Specifiying_weights_in_log-rank_comparisons.html

Or is this already implemented and I've failed to locate the help texts? :)

All the best,

ddsjoberg commented 1 week ago

We have little wrappers for p-values calculated with survival::survdiff() via add_p(), which includes some of the tests you list above.

The real beauty of this pkg, however, is that is integrates with fully with ggplot, so you don't need the package to implement anything for you. You can just calculate a p-value and add it as a caption or place it in the plot, or put it wherever, using the ggplot functions. Here are some examples placing p-values on the figure: https://www.danieldsjoberg.com/ggsurvfit/reference/survfit2_p.html