pharmaverse / ggsurvfit

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

implement `survfit2_hr` and optimize `survfit2_p` #187

Closed Yunuuuu closed 6 months ago

Yunuuuu commented 6 months ago

What changes are proposed in this pull request? add function survfit2_hr to calculate Hazard ratio


Reviewer Checklist (if item does not apply, mark as complete)

When the branch is ready to be merged into master:

Yunuuuu commented 6 months ago

It would be beneficial if the function survfit2_p could directly provide the p-value. Additionally, format can accept purrr-style formula now.

Yunuuuu commented 6 months ago

This also deals with the issue of partial argument matching for some functions like scale_y_continous (labels) and add_quantile (y_value).

ddsjoberg commented 6 months ago

@Yunuuuu thank you for the pull request.

the typical lifecycle here would be to file an issue where the implementation is discussed. after an API/implementation has been agreed upon, then we'd discuss who would make the update.

I took a quick look, and I see there is an issue when there are 3+ groups. The function returns a single p-value when most users would expect multiple HRs.

I think a better first step than a new function would be a simple example adding a table of Cox results as an annotation.

Perhaps create an issue and let's discuss further in the new year?