Skip to content

Add survival analysis and competing risks integration#229

Open
xushenbo wants to merge 1 commit intoDoubleML:mainfrom
xushenbo:feature/survival-analysis-integration
Open

Add survival analysis and competing risks integration#229
xushenbo wants to merge 1 commit intoDoubleML:mainfrom
xushenbo:feature/survival-analysis-integration

Conversation

@xushenbo
Copy link
Copy Markdown

Summary

This PR integrates survival analysis and competing risks estimation into the DoubleML R package, using the SuperLearner/survSuperLearner framework for nuisance function estimation.

New classes

  • DoubleMLSurvival — abstract base class for survival models
  • DoubleMLSurvivalProb — survival probability ATE at time τ
  • DoubleMLRMST — restricted mean survival time (RMST) ATE up to τ
  • DoubleMLCompeting — abstract base class for competing risks models
  • DoubleMLCIFJ — cumulative incidence function (CIF) ATE for cause j at time τ
  • DoubleMLRMTLJ — restricted mean time lost (RMTL) ATE for cause j up to τ

Key features

  • Doubly-robust efficient influence function (EIF/UEIF) based estimation
  • Cross-fitted nuisance estimation via SuperLearner (propensity) and survSuperLearner (survival/censoring)
  • Multiple τ values in a single fit
  • Simultaneous confidence bands via Gaussian multiplier bootstrap (get_inference_curve(npath=))
  • Separable direct/indirect effects for competing risks (get_separable_*, get_inference_curve_sep_*)

New infrastructure files

  • R/inference_point.R — EIF-based point estimation
  • R/inference_curve.R — simultaneous confidence band computation
  • R/survival_nuisance.R — cross-fitted S/G nuisance estimation
  • R/dataset_censored.R — DGP helpers for survival and competing risks data

Tests

  • tests/testthat/test-double_ml_rmst.R
  • tests/testthat/test-double_ml_survival_prob.R
  • tests/testthat/test-double_ml_cifj.R
  • tests/testthat/test-double_ml_rmtlj.R

All tests use real ML (SuperLearner/survSuperLearner), cross-fitting with n_folds=2, and makeCluster(2) for CRAN compliance (_R_CHECK_LIMIT_CORES_=TRUE).

Test plan

  • devtools::check() — 0 errors, 0 warnings, 2 pre-existing notes
  • devtools::test() — FAIL 0, PASS 2644, SKIP 4
  • styler::style_pkg(style = styler.mlr::mlr_style) applied
  • devtools::document() — docs regenerated, no warnings

🤖 Generated with Claude Code

- DoubleMLSurvival, DoubleMLSurvivalProb, DoubleMLRMST: survival probability
  and RMST estimation with doubly-robust EIF, SuperLearner/survSuperLearner
- DoubleMLCompeting, DoubleMLCIFJ, DoubleMLRMTLJ: competing risks CIF and RMTL
  with separable direct/indirect effects (A*=1 and A*=0)
- Simultaneous confidence bands via Gaussian multiplier bootstrap
  (get_inference_curve, get_inference_curve_sep_*)
- inference_point.R, inference_curve.R: EIF-based point and curve inference
- survival_nuisance.R: cross-fitted S/G nuisance via survSuperLearner
- Tests for all 4 classes; makeCluster(2) for CRAN compliance
- devtools::check() passes: 0 errors, 0 warnings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@xushenbo
Copy link
Copy Markdown
Author

@PhilippBach PR is ready for an initial review. Happy to discuss any structural or implementation questions.

@PhilippBach
Copy link
Copy Markdown
Member

Hi @xushenbo

thank you for opening the PR, we'll go through it and come back to you if there are some fixed to be done.

Thanks for contibuting to DoubleML!

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

Successfully merging this pull request may close these issues.

2 participants