I am seeking some help on how to convert one of my columns in my data frame into others based on it which are tertiles and quartiles. I wish to have one group of the two lower tertiles for the tertile split and 3 of the lower quartiles for the quartile split. I am assessing the threshold effect and would appreciate any help on this. For example this is the code i used for my median split.
honourswork %>% mutate(medianpcr = median(PCR.x)) %>%
mutate(lowmedian = ifelse(PCR.x <= medianpcr, 1, 0)) -> honourswork