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?