Overcome survivorship bias in liver transplant patients I'm working on my master thesis in the field of ML and AI and I'm stuck with a problem related to survivorship bias.
I have ~2000 patients from the national waiting list for liver transplantation. Every patient has around 30 features (age, gender, pathologies, diagnosis, ...) and my job is to obtain the transplant benefit: how much the patient life was extended thanks to the transplant.
Example: given a patient, he was added to the waiting list in 2000. He will die in 2001 if he doesn't receive a transplant. He will die in 2004 if he receives a transplant. This means that the transplant benefit is 36 months or 3 years.
The first step is to build a model to regress how much a patient will survive without receiving a transplant. For example: given model M and patient p_i, I want that M(p_i) = y_i, where y_i is the amount of months p_i survives without getting the transplant.
The problem related to survivorship bias is the following: patients aren't from the same "population":

*

*some patients weren't able to receive a transplant (e.g. discarded because incompatible): group A

*other patients received a transplant and survived some more time: group B


At the moment, I'm forced to train my model M on group A patients because only they haven't received a transplant and they are died because of this. On the contrary group B patients have received a transplant, so cannot be used at this stage.
The issue arises when I want to compute the transplant benefit of transplanted patient p_j:

*

*check when p_j died after the transplant: months_t

*use model M to obtain survival without transplant: M(p_j) = months_w

*transplant benefit = months_t - months_w
Do you see the issue? M was trained only on group A patients, so it is highly inaccurate when applied to group B patients. It's a survivorship bias problem because the group that I can use for training doesn't represent the entire population but only a subset, that is, only patients discarded and incompatible.
Is there a way to overcome this problem?
It's two days that I'm searching papers and articles on ways to solve this issue, but most of the "solutions" propose to use data I have no access to (e.g. train model M on group B patients, but I haven't their death date without transplant!)
TL;DR
I have two groups of patients: A and B. Group B has missing labels so I train my model only on group A patients. But this creates huge problems because the different groups have very different populations and characteristics: group B contains patients that survived while group A patients were discarded (survivorship bias).
 A: At the least you need to set this up as a combined competing-risk multi-state model for the various event types, to start trying to control for what you can. Liver transplants provide the example of a competing-risk model in Figure 1.1 of the main R survival vignette and appear frequently in the classic book on survival analysis by Therneau and Grambsch. In your situation, it seems that you would need to model not only the competing transitions from entry to withdrawal ("incompatible"), transplant, and death as in that Figure, but also the transitions from withdrawal to death and from transplant to death.
Provided that there is at least some overlap in covariate values among the groups you identify, you might be able to take advantage of the approaches to counterfactual modeling described by Hernán and Robins. Their book has entire chapters on confounding and selection bias, and 4 chapters in a section on "Causal inference from complex longitudinal data," which seems to describe your situation aptly. There's no way to summarize a book-length treatment here.
None of this, however, would seem to get around the issue of the transplant-assignment process over time noted by Björn unless you have data on the values of assignment-related covariates with time.
