# How to statistically split a set of numbers into two groups for Kaplan-Meier plot?

I want to perform a survival analysis for the cohort of breast cancer patients. For each patient, I know whether he was right-censored or not and what was his survival time (or the end-of-study time if he was right-censored).

For each patient, I also have a digital image file showing a photo of his tissue. I compute a specific numeric value for each image. Thus, at the end of the computation, I have a list of numbers, each number representing some "feature value" associated for that patient.

Now I want to split the set of patients into two groups based on the feature value and plot the Kaplan-Meier curves for the two groups:

surv_object <- Surv(time = cohort$$survival, event = cohort$$censored)
// QUESTION: HOW TO IMPLEMENT THE METHOD?
cohort$$feature <- splitIntoTwoGroups(cohort$$feature)
fit <- survfit(surv_object ~ feature, data = cohort)
ggsurvplot(fit, data = cohort, pval = TRUE)


My question is: what is a good way to statistically separate a set of numbers into two groups?

• Are you asking for clustering methods? Could start with k-means. Other options would be mixture models (e.g. gaussian) – Denwid Feb 28 at 19:18
• You have a continuous feature value and a continuous survival time + right censoring data. I suggest your regress survival time on feature value for the uncensored data. For the censored data (survivors) vs. non-survivors, you could do a simple group comparison of means of your feature value. But as for separating based on the feature value itself, well, is the histogram even bimodal? I would not try to force this. If it is bimodal, then I would follow @Denwid's advice and use a mixture model. – Peter Leopold Feb 28 at 20:35