Correcting for a covariate in a Kaplan-Meier curve I wish to perform a drug survival analysis. Specifically, I wish to see if there are sex differences in drug survival in my dataset. One advantage of my dataset is that it is a large cohort, since fifteen different countries contributed to its creation. However, this also results in statistically significant heterogeneity. One option for me would be to create a KM-curve and stratify by country because of this heterogeneity. However, I was wondering if an option exists to "correct" for countries inside the KM-curve.
Would love to hear if something like this is possible and/or whether this is wise.

To do an adequate job on the problem requires significant background study in the field of survival analysis.  In particular you should get familiar with the Cox proportional hazards model as a generalization of the Kaplan-Meier approach.  Then you would know how to adjust for sex as a covariate, and how to take regional differences into account.  If outcomes are different across regions, ignoring region would be a mistake.  You have two ways to model variables with the Cox model: as covariates and as stratification factors.
