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

surv_fit doesn't support weights parameter #644

Open
raffaem opened this issue Mar 1, 2024 · 0 comments
Open

surv_fit doesn't support weights parameter #644

raffaem opened this issue Mar 1, 2024 · 0 comments

Comments

@raffaem
Copy link

raffaem commented Mar 1, 2024

Expected behavior

I think survminer::surv_fit doesn't support the weights argument:

f2 <- Surv(time, event) ~ x1
km <- surv_fit(f2,
  data = findf,
  weights = weights
)

results in

Error in model.frame.default(formula = Surv(time, event) ~  : 
  invalid type (closure) for variable '(weights)'

Instead it works correctly with survival::survfit

session_info()

r$> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.2 (2023-10-31)
 os       Arch Linux
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Rome
 date     2024-03-01
 pandoc   3.1.11.1 @ /usr/bin/pandoc

─ Packages ───────────────────────────────────────────────────────────────────────────────
 package       * version date (UTC) lib source
 abind           1.4-5   2016-07-21 [1] CRAN (R 4.3.2)
 backports       1.4.1   2021-12-13 [1] CRAN (R 4.3.2)
 broom         * 1.0.5   2023-06-09 [1] CRAN (R 4.3.2)
 broom.helpers   1.14.0  2023-08-07 [1] CRAN (R 4.3.2)
 cachem          1.0.8   2023-05-01 [1] CRAN (R 4.3.2)
 car             3.1-2   2023-03-30 [1] CRAN (R 4.3.2)
 carData         3.0-5   2022-01-06 [1] CRAN (R 4.3.2)
 cellranger      1.1.0   2016-07-27 [1] CRAN (R 4.3.2)
 cli             3.6.2   2023-12-11 [1] CRAN (R 4.3.2)
 colorspace      2.1-0   2023-01-23 [1] CRAN (R 4.3.2)
 data.table      1.15.2  2024-02-29 [1] CRAN (R 4.3.2)
 devtools        2.4.5   2022-10-11 [1] CRAN (R 4.3.2)
 digest          0.6.34  2024-01-11 [1] CRAN (R 4.3.2)
 dplyr         * 1.1.4   2023-11-17 [1] CRAN (R 4.3.2)
 ellipsis        0.3.2   2021-04-29 [1] CRAN (R 4.3.2)
 fansi           1.0.6   2023-12-08 [1] CRAN (R 4.3.2)
 fastmap         1.1.1   2023-02-24 [1] CRAN (R 4.3.2)
 forcats       * 1.0.0   2023-01-29 [1] CRAN (R 4.3.2)
 fs              1.6.3   2023-07-20 [1] CRAN (R 4.3.2)
 generics        0.1.3   2022-07-05 [1] CRAN (R 4.3.2)
 ggplot2       * 3.5.0   2024-02-23 [1] CRAN (R 4.3.2)
 ggpubr        * 0.6.0   2023-02-10 [1] CRAN (R 4.3.2)
 ggsignif        0.6.4   2022-10-13 [1] CRAN (R 4.3.2)
 glue            1.7.0   2024-01-09 [1] CRAN (R 4.3.2)
 gridExtra       2.3     2017-09-09 [1] CRAN (R 4.3.2)
 gt              0.10.1  2024-01-17 [1] CRAN (R 4.3.2)
 gtable          0.3.4   2023-08-21 [1] CRAN (R 4.3.2)
 gtsummary     * 1.7.2   2023-07-15 [1] CRAN (R 4.3.2)
 hms             1.1.3   2023-03-21 [1] CRAN (R 4.3.2)
 htmltools       0.5.7   2023-11-03 [1] CRAN (R 4.3.2)
 htmlwidgets     1.6.4   2023-12-06 [1] CRAN (R 4.3.2)
 httpuv          1.6.14  2024-01-26 [1] CRAN (R 4.3.2)
 km.ci           0.5-6   2022-04-06 [1] CRAN (R 4.3.2)
 KMsurv          0.1-5   2012-12-03 [1] CRAN (R 4.3.2)
 knitr           1.45    2023-10-30 [1] CRAN (R 4.3.2)
 labeling        0.4.3   2023-08-29 [1] CRAN (R 4.3.2)
 later           1.3.2   2023-12-06 [1] CRAN (R 4.3.2)
 lattice         0.21-9  2023-10-01 [2] CRAN (R 4.3.2)
 lifecycle       1.0.4   2023-11-07 [1] CRAN (R 4.3.2)
 lubridate     * 1.9.3   2023-09-27 [1] CRAN (R 4.3.2)
 magrittr        2.0.3   2022-03-30 [1] CRAN (R 4.3.2)
 Matrix          1.6-1.1 2023-09-18 [2] CRAN (R 4.3.2)
 memoise         2.0.1   2021-11-26 [1] CRAN (R 4.3.2)
 mime            0.12    2021-09-28 [1] CRAN (R 4.3.2)
 miniUI          0.1.1.1 2018-05-18 [1] CRAN (R 4.3.2)
 munsell         0.5.0   2018-06-12 [1] CRAN (R 4.3.2)
 pillar          1.9.0   2023-03-22 [1] CRAN (R 4.3.2)
 pkgbuild        1.4.3   2023-12-10 [1] CRAN (R 4.3.2)
 pkgconfig       2.0.3   2019-09-22 [1] CRAN (R 4.3.2)
 pkgload         1.3.4   2024-01-16 [1] CRAN (R 4.3.2)
 profvis         0.3.8   2023-05-02 [1] CRAN (R 4.3.2)
 promises        1.2.1   2023-08-10 [1] CRAN (R 4.3.2)
 purrr         * 1.0.2   2023-08-10 [1] CRAN (R 4.3.2)
 R6              2.5.1   2021-08-19 [1] CRAN (R 4.3.2)
 raffalib      * 0.1     2024-02-29 [1] local
 Rcpp            1.0.12  2024-01-09 [1] CRAN (R 4.3.2)
 readr         * 2.1.5   2024-01-10 [1] CRAN (R 4.3.2)
 readxl        * 1.4.3   2023-07-06 [1] CRAN (R 4.3.2)
 remotes         2.4.2.1 2023-07-18 [1] CRAN (R 4.3.2)
 rlang           1.1.3   2024-01-10 [1] CRAN (R 4.3.2)
 rstatix         0.7.2   2023-02-01 [1] CRAN (R 4.3.2)
 scales          1.3.0   2023-11-28 [1] CRAN (R 4.3.2)
 sessioninfo     1.2.2   2021-12-06 [1] CRAN (R 4.3.2)
 shiny           1.8.0   2023-11-17 [1] CRAN (R 4.3.2)
 stringi         1.8.3   2023-12-11 [1] CRAN (R 4.3.2)
 stringr       * 1.5.1   2023-11-14 [1] CRAN (R 4.3.2)
 survival      * 3.5-7   2023-08-14 [2] CRAN (R 4.3.2)
 survminer     * 0.4.9   2021-03-09 [1] CRAN (R 4.3.2)
 survMisc        0.5.6   2022-04-07 [1] CRAN (R 4.3.2)
 tibble        * 3.2.1   2023-03-20 [1] CRAN (R 4.3.2)
 tidyr         * 1.3.1   2024-01-24 [1] CRAN (R 4.3.2)
 tidyselect      1.2.0   2022-10-10 [1] CRAN (R 4.3.2)
 tidyverse     * 2.0.0   2023-02-22 [1] CRAN (R 4.3.2)
 timechange      0.3.0   2024-01-18 [1] CRAN (R 4.3.2)
 tzdb            0.4.0   2023-05-12 [1] CRAN (R 4.3.2)
 urlchecker      1.0.1   2021-11-30 [1] CRAN (R 4.3.2)
 usethis         2.2.3   2024-02-19 [1] CRAN (R 4.3.2)
 utf8            1.2.4   2023-10-22 [1] CRAN (R 4.3.2)
 vctrs           0.6.5   2023-12-01 [1] CRAN (R 4.3.2)
 withr           3.0.0   2024-01-16 [1] CRAN (R 4.3.2)
 xfun            0.42    2024-02-08 [1] CRAN (R 4.3.2)
 xml2            1.3.6   2023-12-04 [1] CRAN (R 4.3.2)
 xtable          1.8-4   2019-04-21 [1] CRAN (R 4.3.2)
 zoo             1.8-12  2023-04-13 [1] CRAN (R 4.3.2)

 [1] /home/raffaele/R/x86_64-pc-linux-gnu-library/4.3
 [2] /usr/lib/R/library

──────────────────────────────────────────────────────────────────────────────────────────

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant