Skip to content

Survival strata usage may cause some issues #514

@kieranjmartin

Description

@kieranjmartin

In this page and a few others the code to use strata is given as follows:

fit.km.str <- survival::survfit(
  survival::Surv(LENFOLY, FSTAT) ~ AFB + survival::strata(GENDER),
  data = dat
)

survminer::surv_pvalue(fit.km.str, data = dat)

Unfortunately, for anyone using survival 3.8.0 or earlier this code will not work! As per the news up until that point doing survival::strata in a formula won't create a strata as you might expect.

I ran into this issue today and spent a few hours trying to work out what on earth was wrong before stumbling across the solution by using a later version of survival. As many pharma users may have a fixed version of survival (It looks like from CRAN that 3.8.3 became available in December of last year, the other versions either weren't released on cran or have been removed from the archive)

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