OSCR

A comprehensive simulation study evaluating the predictive performance of Cox proportional hazards model and machine learning methods for time-to-event data.

Code ↔ Paper

4 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 4 matches · 3 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
  1. [1] § Materials and methods › Real survival data ↔ sim_data.R, lines 1 to 32 · score 0.95 · stroke alert, Rankin Scale, stroke unit, age, ambulance, anticoagulants · Report a mismatch
  2. [2] § Results › Stroke survival results ↔ metrics.R, the whole file · a weak match · score 0.61 · RSF models, XGBoost model, Cox PH model, fitted, DeepSurv, prediction · Report a mismatch
  3. [3] § Materials and methods › Simulation of survival data ↔ metrics.R, the whole file · a weak match · score 0.55 · XGBoost, Cox PH model, fitted, DeepSurv, RSF, risk · Report a mismatch
  4. [4] § Materials and methods › Simulation of survival data ↔ metric_correctPH.R, the whole file · a weak match · score 0.50 · survSplit, Cox PH, fitted, risk, trained, predictive · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R · 110 lines · 5 KB · no license · 2 matches

  1. #------------------------------------------------------------------------------------------#
  2. # A function to fit the models and calculate metrics : IBS/Cstats #
  3. #-------------------------------------------------------------------------------------------#
  4. models_metric_IBS <- function(train_df, test_df){
  5. #fit models
  6. fmla <- Surv(time = time, event = status) ~ .
  7. # 1 RSF model: 'logrank'
  8. rsf_model <- rfsrc(formula = fmla, data = train_df, splitrule = "logrank",
  9. mtry = as.integer(sqrt(ncol(train_df[, !names(train_df) %in% c("time", "status")]))))
  10. rsf_predict <- get_predictions(fitted_model = rsf_model, newdata = test_df) # times = rsf_model$time.interest
  11. # 2. Cox PH model
  12. cph_model <- coxph(formula = fmla, data = train_df, x=T, y=T)
  13. cph_predict <- get_predictions(fitted_model = cph_model, newdata = test_df, times = rsf_model$time.interest)
  14. # 3. Survival neural network model
  15. nn_model <- deepsurv(fmla, data = train_df, frac = 0)
  16. nn_predict <- get_predictions(fitted_model = nn_model, newdata = test_df)
  17. # 4. XGBoost for survival analysis
  18. # Prepare the training and validation data for XGBoost
  19. x_label <- ifelse(train_df$status == 1, train_df$time, -train_df$time)
  20. x_train <- as.matrix(train_df %>% select(-time, -status))
  21. Dtrain <- xgb.DMatrix(x_train, label = x_label)
  22. surv_xgboost_model <- xgb.train.surv(
  23. params = list(objective = "survival:cox", eval_metric = "cox-nloglik"),
  24. data = x_train, label = x_label, nrounds = 100)
  25. xgb_predict <- get_predictions(fitted_model = surv_xgboost_model, newdata = test_df, times = rsf_model$time.interest)
  26. times <- test_df$time
  27. status <- test_df$status
  28. # 1. RSF model
  29. IBS_rsf <- my_sbrier(Surv(times, status), pred = t(rsf_predict$surv), btime = rsf_predict$times)[1,1]
  30. # 2. Cox PH model
  31. IBS_cox <- my_sbrier(Surv(times, status), pred = t(cph_predict$surv), btime = cph_predict$times)[1,1]
  32. # 3. Survival neural network model
  33. IBS_nn <- my_sbrier(Surv(times, status), pred = t(nn_predict$surv), btime = nn_predict$times)[1,1]
  34. # 4. XGBoost for survival analysis
  35. IBS_xgb <- my_sbrier(Surv(times, status), pred = t(xgb_predict$surv), btime = xgb_predict$times)[1,1]
  36. # }else{
  37. prob = .95
  38. z <- qnorm((1-prob)/2)
  39. # Harrell's Cstats
  40. # 1. Cox PH model
  41. cox_index.H <- concordance(object = Surv(time = times, event = status) ~ cph_predict$risk, data=test_df, reverse = TRUE)
  42. cox_c_CI.H <- cox_index.H$concordance + c(0, z, -z) * sqrt(cox_index.H$var)
  43. # 2. RSF model
  44. rsf_index.H <- concordance(object = Surv(time = times, event = status) ~ rsf_predict$risk, data=test_df, reverse = TRUE)
  45. rsf_c_CI.H <- rsf_index.H$concordance + c(0, z, -z) * sqrt(rsf_index.H$var)
  46. # 3. XGBoost for survival analysis
  47. xgb_index.H <- concordance(object = Surv(time = times, event = status) ~ xgb_predict$risk, data=test_df, reverse = TRUE)
  48. xgb_c_CI.H <- xgb_index.H$concordance + c(0, z, -z) * sqrt(xgb_index.H$var)
  49. # 4. Survival neural network model
  50. nn_index.H <- concordance(object = Surv(time = times, event = status) ~ nn_predict$risk, data = test_df, reverse = TRUE)
  51. nn_c_CI.H <- nn_index.H$concordance + c(0, z, -z) * sqrt(nn_index.H$var)
  52. #Uno's Cstats
  53. # 1. Cox PH model
  54. cox_index.U <- concordance(object = Surv(time = times, event = status) ~ cph_predict$risk, data=test_df, reverse = TRUE,timewt= "n/G2")
  55. cox_c_CI.U <- cox_index.U$concordance + c(0, z, -z) * sqrt(cox_index.U$var)
  56. # 2. RSF model
  57. rsf_index.U <- concordance(object = Surv(time = times, event = status) ~ rsf_predict$risk, data=test_df, reverse = TRUE,timewt= "n/G2")
  58. rsf_c_CI.U <- rsf_index.U$concordance + c(0, z, -z) * sqrt(rsf_index.U$var)
  59. # 3. XGBoost for survival analysis
  60. xgb_index.U <- concordance(object = Surv(time = times, event = status) ~ xgb_predict$risk, data=test_df, reverse = TRUE,timewt= "n/G2")
  61. xgb_c_CI.U <- xgb_index.U$concordance + c(0, z, -z) * sqrt(xgb_index.U$var)
  62. # 4. Survival neural network model
  63. nn_index.U <- concordance(object = Surv(time = times, event = status) ~ nn_predict$risk, data = test_df, reverse = TRUE,timewt= "n/G2")
  64. nn_c_CI.U <- nn_index.U$concordance + c(0, z, -z) * sqrt(nn_index.U$var)
  65. # Output
  66. models <- c("XGBoost", "RSF-logrank", "Cox PH", "NN")
  67. c_index.H <- c(xgb_c_CI.H[1], rsf_c_CI.H[1], cox_c_CI.H[1], nn_c_CI.H[1])
  68. lower_ci.H <- c(xgb_c_CI.H[2], rsf_c_CI.H[2], cox_c_CI.H[2], nn_c_CI.H[2])
  69. upper_ci.H <- c(xgb_c_CI.H[3], rsf_c_CI.H[3], cox_c_CI.H[3], nn_c_CI.H[3])
  70. c_index.U <- c(xgb_c_CI.U[1], rsf_c_CI.U[1], cox_c_CI.U[1], nn_c_CI.U[1])
  71. lower_ci.U <- c(xgb_c_CI.U[2], rsf_c_CI.U[2], cox_c_CI.U[2], nn_c_CI.U[2])
  72. upper_ci.U <- c(xgb_c_CI.U[3], rsf_c_CI.U[3], cox_c_CI.U[3], nn_c_CI.U[3])
  73. IBS_val <- c(IBS_xgb, IBS_rsf, IBS_cox, IBS_nn)
  74. d.frame <- data.frame(Model = models,
  75. C_index_H = c_index.H, Lower_CI_H = lower_ci.H, Upper_CI_H = upper_ci.H,
  76. C_index_U = c_index.U, Lower_CI_U = lower_ci.U, Upper_CI_U = upper_ci.U,
  77. IBScore = IBS_val)
  78. return(d.frame)
  79. }

metrics.R at commit df54dd9, no license · at the source

Overview

Authors: Josline Adhiambo Otieno1, Jenny Häggström1, Marie Eriksson1
  1. Department of Statistics, USBE, Umeå University,Samhällsvetarhuset, Biblioteksgränd 6, Umeå, 901 87 Sweden
Institutions: Umeå University (Sweden)
Journal: BMC medical research methodology, volume 26, issue 1, article 240
Dates: received 11 October 2025; accepted 12 October 2026; published online 10 November 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1186/s12874-026-03050-5 · PMID 43004245 · PMCID PMC13749909 · OpenAlex W7225730457
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: computational modeling (no new data) (modality), human (organism), stroke (population), computational (subfield)
Methods: Machine learning, Statistics
Keywords: Simulation, Machine learning, Survival analysis, Predictive modeling, Stroke
MeSH: Machine Learning*, Boosting Machine Learning Algorithms, Computer Simulation, Humans, Prediction Algorithms, Predictive Learning Models, Proportional Hazards Models, Random Forest, Risk Assessment, Survival Analysis (* major topic)
Topic: Statistical Methods and Inference (Statistics and Probability, Mathematics), according to OpenAlex
Funding: Umea University
Citations: not cited yet (Europe PMC); 61 references in the paper

Abstract

Background: Many data-driven risk prediction models have been developed for analyzing time-to-event data. However, choosing the most suitable model for accurate predictions in a specific medical application remains a challenge. Simulation enables effective comparison on the basis of equal-sized datasets. This study provided a comprehensive and fair comparison of the overall survival prediction performance of machine learning models and the traditional Cox proportional hazards model, using both simulated and real datasets.

Methods: Machine learning models included random survival forests, eXtreme Gradient Boosting, and deep neural networks (DeepSurv). We evaluated the performance of the models using the C-index and the Integrated Brier Score. The evaluation was performed under different data-generating mechanisms, such as varying sample sizes, censoring proportions, the addition of noise variables, and in the presence of different types of model misspecification.

Results: All the models showed improved predictive performance with increasing sample sizes. However, their performance declined as the proportion of censoring increased. An increase in noise variables reduced prediction accuracy across all models, regardless of dataset size. Tree-based models demonstrated promising predictive performance compared to the Cox proportional hazards model and DeepSurv in the presence of misspecification and a large number of noise variables. The Cox proportional hazards model performed well with larger sample sizes and fewer noise variables. It also performed well when the model was correctly specified or had only minor misspecification.

Conclusions: Appropriate model for a specific medical application should be motivated by the research question and the underlying data structure.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.

Josline90/Cox-vs-ML-models-for-time-to-event-data_A-simulation-study

License: none: the authors keep all their rights
State: the link answers, verified on 12 November 2026
Evidence: files inventoried
Commit: df54dd9e5181d78b43bfc8c921e95c0913382095, 7 October 2026
Languages: R (8)
Size: 9 files, 8 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: caret (1 file), ggplot2 (1 file), reticulate (1 file), survival (1 file), tidyverse (1 file), XGBoost (1 file)
Availability: 1 check, the latest on 12 November 2026: the link answers
  • 12 November 2026: the link answers
9 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 8 scripts, each with its path and the digest of its content;
  • 4 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

The analysis code is publicly available in a Github repository https://github.com/Josline90/Cox-vs-ML-models-for-time-to-event-data_A-simulation-study.git. The real data analyzed in the study consist of third-party data from Riksstroke and its use has been approved by the Swedish Ethical Review Authority (reference number 2021 - 06152 - 01). According to Swedish legislation data cannot be made available for use beyond what has been approved by the ethical review authority. Therefore, the data cannot be made publicly available. Data may be made available from Riksstroke (contact via ) upon reasonable request by researchers who meet the criteria for access to confidential data according to Swedish laws and regulations.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 12 November 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 5 keywords, 10 MeSH terms, 1 funder, 52 references.

Cite

This paper

Otieno, J. A., Häggström, J., & Eriksson, M. (2026). A comprehensive simulation study evaluating the predictive performance of Cox proportional hazards model and machine learning methods for time-to-event data. BMC medical research methodology, 26(1), 240. https://doi.org/10.1186/s12874-026-03050-5

BibTeX

@article{otieno2026comprehensive,
author = {Otieno, Josline Adhiambo and Häggström, Jenny and Eriksson, Marie},
title = {{A comprehensive simulation study evaluating the predictive performance of Cox proportional hazards model and machine learning methods for time-to-event data}},
journal = {BMC medical research methodology},
year = {2026},
month = nov,
volume = {26},
number = {1},
pages = {240},
publisher = {BMC},
issn = {1471-2288},
doi = {10.1186/s12874-026-03050-5},
url = {https://doi.org/10.1186/s12874-026-03050-5},
pmid = {43004245},
pmcid = {PMC13749909}
}

RIS

TY - JOUR
AU - Otieno, Josline Adhiambo
AU - Häggström, Jenny
AU - Eriksson, Marie
TI - A comprehensive simulation study evaluating the predictive performance of Cox proportional hazards model and machine learning methods for time-to-event data
T2 - BMC medical research methodology
J2 - BMC Med Res Methodol
PY - 2026
DA - 2026/11/10
VL - 26
IS - 1
SP - 240
SN - 1471-2288
PB - BMC
DO - 10.1186/s12874-026-03050-5
UR - https://doi.org/10.1186/s12874-026-03050-5
LA - en
ER -

CSL-JSON

{
"id": "10.1186/s12874-026-03050-5",
"type": "article-journal",
"title": "A comprehensive simulation study evaluating the predictive performance of Cox proportional hazards model and machine learning methods for time-to-event data",
"container-title": "BMC medical research methodology",
"author": [
{
"family": "Otieno",
"given": "Josline Adhiambo"
},
{
"family": "Häggström",
"given": "Jenny"
},
{
"family": "Eriksson",
"given": "Marie"
}
],
"container-title-short": "BMC Med Res Methodol",
"volume": "26",
"issue": "1",
"page": "240",
"DOI": "10.1186/s12874-026-03050-5",
"PMID": "43004245",
"PMCID": "PMC13749909",
"ISSN": "1471-2288",
"publisher": "BMC",
"URL": "https://doi.org/10.1186/s12874-026-03050-5",
"language": "en",
"issued": {
"date-parts": [
[
2026,
11,
10
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41598-023-47935-7 [code]
Accurate personalized survival prediction for amyotrophic lateral sclerosis patients.
Journal: Scientific reports
In common: survival, caret, reticulate, 2 other tools, 4 references
[2] doi:10.3390/genes16050473 [code]
Enhancing Prognostic Signatures in Glioblastoma with Feature Selection and Regularised Cox Regression.
Journal: Genes
In common: survival, caret, ggplot2, 1 other tool, 4 references
[3] doi:10.1371/journal.pone.0336476 [code]
A meaningful prediction of functional decline in amyotrophic lateral sclerosis based on multi-event survival analysis.
Journal: PloS one
In common: 7 references
[4] doi:10.1016/j.isci.2023.107522 [code]
Deep learning for risk-based stratification of cognitively impaired individuals.
Journal: iScience
In common: survival, caret, XGBoost, 2 other tools, 2 references
[5] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: survival, caret, XGBoost, 3 other tools
[6] doi:10.1038/s43856-023-00276-y [code]
Multimodal deep learning to predict prognosis in adult and pediatric brain tumors.
Journal: Communications medicine
In common: survival, 4 references
[7] doi:10.1186/s13014-026-02825-w [code]
Prediction of local failure after stereotactic radiotherapy in melanoma brain metastases using ensemble learning on clinical, dosimetric, and radiomic data.
Journal: Radiation oncology (London, England)
In common: survival, caret, reticulate, 1 other tool, 1 reference
[8] doi:10.3390/ijms27156925 [code]
XGBoost-SHAP Interpretable Modeling Identifies and Validates an Eight-Gene Biomarker for Hepatic Encephalopathy Risk Prediction in Cirrhosis.
Journal: International journal of molecular sciences
In common: survival, caret, XGBoost, 2 other tools
[9] doi:10.21037/jtd-2026-0997 [code]
Machine learning models based on XGBoost algorithm to predict prognosis of lung cancer brain metastases.
Journal: Journal of thoracic disease
In common: survival, caret, XGBoost, 2 other tools
[10] doi:10.7554/elife.99538 [code]
Menopausal hormone therapy and the female brain: Leveraging neuroimaging and prescription registry data from the UK Biobank cohort.
Journal: eLife
In common: survival, caret, XGBoost, 2 other tools

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1186/s12874-026-03050-5.svg)](https://openscicode.org/badge/doi/10.1186/s12874-026-03050-5)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1186/s12874-026-03050-5.svg
   :target: https://openscicode.org/badge/doi/10.1186/s12874-026-03050-5
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1186/s12874-026-03050-5"><img src="https://openscicode.org/badge/doi/10.1186/s12874-026-03050-5.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.