Skip to content

Bug in tidy.survfit() coming in the next release of the {survival} pkg #1195

@ddsjoberg

Description

@ddsjoberg

Hello, The authors of the {survival} package are prepping a release to CRAN and plan to submit in two weeks. The tidy.survfit() function does not error with the new version; however, the results are not correct for multi-state models (the most common type is competing risks).

I haven't looked into the details too much, but it seems that in the new version the number of censored subjects is stored as a matrix, where previously it was a vector.

I prepared an example illustrating the differences in the result from the current release of CRAN to the dev version.
https://rpubs.com/ddsjoberg/1174489

Below is a table showing the difference in the reported number of censored subjects from the current CRAN release (n.censor.cran) compared to dev (n.censor.dev). The dev version of the package is here www.github.com/therneau/survival

## # A tibble: 58 × 4
##    state         time n.censor.cran n.censor.dev
##    <chr>        <dbl>         <int>        <dbl>
##  1 cancer death 0.130             1            0
##  2 cancer death 0.153             1            0
##  3 cancer death 0.192             1            0
##  4 cancer death 0.192             1            0
##  5 cancer death 0.202             1            0
##  6 cancer death 0.211             1            0
##  7 cancer death 0.269             1            0
##  8 cancer death 0.288             1            0
##  9 cancer death 0.292             1            0
## 10 cancer death 0.343             1            0
## # ℹ 48 more rows

I would submit a PR myself, but I can't this week and I am traveling next week. I hope someone from the community has the bandwidth to address this important issue for an incredibly common package and method.

Thanks,
Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions