Create groups based on survival

Hi,
I have survival data from about 100 patients. I would like to divide my cohort into 2 groups: a group of 50% of the best surviving patients and a group of 50% of the worst surviving patients. How do I do this?
Thanks

Alex

Create a new column in your dataset, and code them either 0 or 1.

1 Like

So, for example, taking a simplified data frame consisting of single numeric variable

set.seed(42)
dat <- data.frame(score = sample(1:100,100,replace = TRUE))
dat$category <- ifelse(dat$score < median(dat$score),0,1)
head(dat)
#>   score category
#> 1    49        1
#> 2    65        1
#> 3    25        0
#> 4    74        1
#> 5   100        1
#> 6    18        0