Related Experiment Video
Updated: Jul 15, 2025

An R-Based Landscape Validation of a Competing Risk Model
Published on: September 16, 2022
causalCmprsk: An R package for nonparametric and Cox-based estimation of average treatment effects in competing risks
Bella Vakulenko-Lagun1, Colin Magdamo2, Marie-Laure Charpignon3
1Department of Statistics, University of Haifa, Haifa, Israel.
Background And Objective:
Competing risks data arise in both observational and experimental clinical studies with time-to-event outcomes, when each patient might follow one of the multiple mutually exclusive competing paths. Ignoring competing risks in the analysis can result in biased conclusions. In addition, possible confounding bias of the treatment-outcome relationship has to be addressed, when estimating treatment effects from observational data. In order to provide tools for estimation of average treatment effects on time-to-event outcomes in the presence of competing risks, we developed the R package causalCmprsk. We illustrate the package functionality in the estimation of effects of a right heart catheterization procedure on discharge and in-hospital death from observational data.
Methods:
The causalCmprsk package implements an inverse probability weighting estimation approach, aiming to emulate baseline randomization and alleviate possible treatment selection bias. The package allows for different types of weights, representing different target populations. causalCmprsk builds on existing methods from survival analysis and adapts them to the causal analysis in non-parametric and semi-parametric frameworks.
Results:
The causalCmprsk package has two main functions: fit.cox assumes a semiparametric structural Cox proportional hazards model for the counterfactual cause-specific hazards, while fit.nonpar does not impose any structural assumptions. In both frameworks, causalCmprsk implements estimators of (i) absolute risks for each treatment arm, e.g., cumulative hazards or cumulative incidence functions, and (ii) relative treatment effects, e.g., hazard ratios, or restricted mean time differences. The latter treatment effect measure translates the treatment effect from probability into more intuitive time domain and allows the user to quantify, for example, by how many days or months the treatment accelerates the recovery or postpones illness or death.
Conclusions:
The causalCmprsk package provides a convenient and useful tool for causal analysis of competing risks data. It allows the user to distinguish between different causes of the end of follow-up and provides several time-varying measures of treatment effects. The package is accompanied by a vignette that contains more details, examples and code, making the package accessible even for non-expert users.
Related Concept Videos
The Mantel-Cox Log-Rank Test
Comparing the Survival Analysis of Two or More Groups
Kaplan-Meier Approach
Parametric Survival Analysis: Weibull and Exponential Methods
Weibull Distribution
The Weibull distribution is a flexible model used in parametric survival analysis. It can handle both increasing and decreasing hazard rates, depending on its shape parameter...
Assumptions of Survival Analysis
Introduction To Survival Analysis
The primary goal of survival analysis is to estimate survival time—the time...

