I have a data in which I have to apply a competing risk. 4 variables:

  • Temps_Competing_Descompensacio: the time to event.
  • Competing_Descompensacio: factor variable to identifie the event, censored, event or competing event.
  • Grup_IQ: stratified analisis (2 groups).
  • IPTW: the weights of the observation from a previous propensity score phase.

enter image description here

My problem is to apply a method for competing risks with the propensity score IPTW weights.

I haven't found a way to do it. The analysis without the weights was correct. Already tested and compared with a SAS sintax. Here my code from the for the crr function from the cmprsk package

fit.crr <- crr(ftime = Competing_dataset$Temps_Competing_Descompensacio, 
               fstatus = Competing_dataset$Competing_Descompensacio,
               cov1 = Competing_dataset$Grup_IQ, failcode = 1, cencode = 0)

The issue comes when I try to add the weights, as I do not see or find an argument to ponderate the results. I considered multiplying the time variables for the weights, but does not seem correct from methodolgy perspective, and I haven't found a solution from other libraries.

  • $\begingroup$ Agree with Denzo about the importance of the choice of the estimand (pubmed.ncbi.nlm.nih.gov/31985089). Assuming a difference in (crude) cumulative probabilities is what you want, you can fit IPTW cause-specific hazard models, derive Cumul. Incidence Functions from the csh models (eg onlinelibrary.wiley.com/doi/10.1002/sim.2712), and finally calculate the risk differences. If you condition the csh models on covariates, you may want to marginalise the CIFs over the covariates' joint distribution first. Check out the ate() function from the riskRegression R package. $\endgroup$
    – boscovich
    Commented Apr 2 at 10:57

1 Answer 1


As far as I know, there is no way to fit a weighted Fine & Gray model in R. But that may not be necessary, or even the best idea for your study question. I would recommend thinking about what your target estimand really is. What do you want to estimate?

Given that you are using the IPTW method, it seems like your goal is to estimate some sort of average causal effect. If that is indeed the case, any type of hazard-ratio (even those from a normal cox model) may not be a suitable target estimand (see for example https://pubmed.ncbi.nlm.nih.gov/26100005/).

You may want to use something like the cause-specific failure probability at time $t$ or the restricted mean time lost (see https://bmcmedresmethodol.biomedcentral.com/articles/10.1186/s12874-020-01040-9) as a target estimand. Both of these quantities can be estimated using IPTW with competing-risks data using the adjustedCurves package. The adjustedcif(), adjusted_curve_diff() and adjusted_rmtl() functions may be helpfull in this case.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.