insightsengineering / insightsengineering/ggplot2.utils

Add support for other survival estimates

Offen
#86 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
R
Sterne
9
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently using this package it is only possible to add reference lines for survival estimates via KM estimates. However it is common for users to plot their survival data in terms of transformations of the survival function e.g.

- Hazard function
- Cumulative Hazard function
- Log Hazard function

It would be good for this package to support these as well.

Cumulative Hazard estimates are already available from the `survfit` function
```
x <- survfit(Surv(time, event) ~ 1, data = dat)
x$cumhaz
```

Hazard functions are more complex. I'm not sure what the best way is but I see many recommendations for [`muhaz`](https://rdrr.io/cran/muhaz/man/muhaz.html) e.g.
```
muhaz::muhaz(dat$time, dat$event)
```
Though it doesn't appear to have a grouping option so you would need to loop over the required groups.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.