Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Life table #263

Open
timtreis opened this issue Sep 24, 2021 · 1 comment
Open

Life table #263

timtreis opened this issue Sep 24, 2021 · 1 comment
Assignees
Labels
idea To post an idea for a new plot new_visualisation A new plot/table to add to the package

Comments

@timtreis
Copy link
Collaborator

timtreis commented Sep 24, 2021

Idea

As discussed during PSI2021, life tables might be a thing that we should implement. It seems like a fairly quick win and would be an additional feature integrating into the time-to-event-analysis theme.

Do you have any examples you can share of what it looks like?

https://en.wikipedia.org/wiki/Life_table

visR::adtte %>%
  visR::estimate_KM() %>%
  visR::get_risktable(statlist = c("n.risk", "n.event", "n.censor")) %>%
  tidyr::spread(y_values, Overall) %>%
  visR::render(title = "Life table", datasource = "visR::adtte")

david_output

What potential packages/functions could be used to make this plot?

Farily easy with tidyr and visR, merely a wrapper around a bunch of stuff that's already implemented. Would be nice to have some standard intervals on the left (regularily spaced, smart guessing?) but to also expose the option of custom intervals like

visR::adtte %>%
  visR::estimate_KM() %>%
  visR::lifetable(intervals = list(c(-Inf, 18), c(19-60), c(61, Inf)),
                  columns = c("n.risk", "n.event", "n.censor", "survival", "CI_lower", "CI_upper"))
@timtreis timtreis added enhancement New feature or request idea To post an idea for a new plot labels Sep 24, 2021
@timtreis timtreis added new_visualisation A new plot/table to add to the package and removed enhancement New feature or request labels Sep 24, 2021
@SHAESEN2
Copy link
Collaborator

SHAESEN2 commented Sep 28, 2021

We have this functionality already

get_risktable(survfit_visR,
times = c(0,5,10,20,13),
group="statlist"
)

There is a bug where the labels are not put into the column names. @rebecca-albrecht is this something we can have a look at? If we want to put this helper function forwards for life tables, we might want to clean it up and see if it still integrates nicely with add_risktable and your summaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea To post an idea for a new plot new_visualisation A new plot/table to add to the package
Projects
None yet
Development

No branches or pull requests

3 participants