csetraynor / predsurv

Package for variable selection and inference in survival models.
0 stars 0 forks source link

error with Brier scores #1

Closed Al3n70rn closed 4 years ago

Al3n70rn commented 5 years ago

Hi,

I am having this error when I try to reproduce the example from the vignette:

brier_lasso <- predsurv::fun_test(obj = mod_lasso, train_data = train, test_data = test, pred = "Brier", integrated = FALSE)

Error in coxModelFrame.coxph(object) : invalid object set x=TRUE in the call to coxph

By the way, I had the same error with R version 3.5.2

my session

sessionInfo() R version 3.5.3 (2019-03-11) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.10

Matrix products: default BLAS: /usr/local/lib/R/lib/libRblas.so LAPACK: /usr/local/lib/R/lib/libRlapack.so

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=fr_FR.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods
[7] base

other attached packages: [1] glmnet_2.0-16 foreach_1.4.4 Matrix_1.2-15
[4] predsurv_0.0.0.9000 survival_2.43-3 ggplot2_3.1.0

loaded via a namespace (and not attached): [1] TH.data_1.0-10 colorspace_1.4-0
[3] class_7.3-15 modeltools_0.2-22
[5] htmlTable_1.13.1 base64enc_0.1-3
[7] rethinking_1.59 rstudioapi_0.9.0
[9] ggpubr_0.2 rstan_2.18.2
[11] MatrixModels_0.4-1 prodlim_2018.04.18
[13] mvtnorm_1.0-10 lubridate_1.7.4
[15] coin_1.3-0 codetools_0.2-16
[17] splines_3.5.3 doParallel_1.0.14
[19] knitr_1.22 libcoin_1.0-4
[21] Formula_1.2-3 doMC_1.3.5
[23] caret_6.0-81 cluster_2.0.7-1
[25] riskRegression_2019.01.29 compiler_3.5.3
[27] backports_1.1.3 assertthat_0.2.0
[29] lazyeval_0.2.1 strucchange_1.5-1
[31] cli_1.0.1 quantreg_5.38
[33] htmltools_0.3.6 acepack_1.4.1
[35] prettyunits_1.0.2 tools_3.5.3
[37] partykit_1.2-3 coda_0.19-2
[39] gtable_0.2.0 glue_1.3.0
[41] reshape2_1.4.3 dplyr_0.8.0.1
[43] Rcpp_1.0.0 nlme_3.1-137
[45] iterators_1.0.10 timeDate_3043.102
[47] inum_1.0-0 xfun_0.5
[49] gower_0.2.0 stringr_1.4.0
[51] ps_1.3.0 tdROC_1.0
[53] polspline_1.1.14 MASS_7.3-51.1
[55] zoo_1.8-4 scales_1.0.0
[57] ipred_0.9-8 parallel_3.5.3
[59] sandwich_2.5-0 SparseM_1.77
[61] inline_0.3.15 RColorBrewer_1.1-2
[63] yaml_2.2.0 gridExtra_2.3
[65] loo_2.0.0 StanHeaders_2.18.1
[67] rms_5.1-3 rpart_4.1-13
[69] latticeExtra_0.6-28 stringi_1.3.1
[71] checkmate_1.9.1 pkgbuild_1.0.2
[73] lava_1.6.5 rlang_0.3.1
[75] pkgconfig_2.0.2 matrixStats_0.54.0
[77] rsample_0.0.4 lattice_0.20-38
[79] purrr_0.3.1 htmlwidgets_1.3
[81] recipes_0.1.4 labeling_0.3
[83] cmprsk_2.2-7 cowplot_0.9.4
[85] processx_3.3.0 tidyselect_0.2.5
[87] plyr_1.8.4 magrittr_1.5.0.9000
[89] R6_2.4.0 generics_0.0.2
[91] Hmisc_4.2-0 multcomp_1.4-10
[93] foreign_0.8-71 pillar_1.3.1
[95] withr_2.1.2 abind_1.4-5
[97] nnet_7.3-12 ggfortify_0.4.5
[99] tibble_2.0.1 crayon_1.3.4
[101] party_1.3-3 timereg_1.9.3
[103] grid_3.5.3 data.table_1.12.1
[105] callr_3.1.1 ModelMetrics_1.2.2
[107] digest_0.6.18 tidyr_0.8.3
[109] numDeriv_2016.8-1 pec_2018.07.26
[111] stats4_3.5.3 munsell_0.5.0

Al3n70rn commented 5 years ago

This suggestion corrects this bug:

https://stackoverflow.com/questions/55105635/error-in-coxmodelframe-coxphobject-invalid-object-set-x-true-in-the-call-to

Probably it predsurv::fun_test coxph should be modified in every proposed model including x = TRUE.

csetraynor commented 4 years ago

Hi Al3nT0rn, Sorry for late reply, yes indeed setting x=TRUE resolve this issue. I will make lots of changes in the master branch from now on. The back branch is saved for reference but may be deleted as it is really not a very useful package for users. Thanks anyway !