Dear R users, given the patient sample with their Gender and Age GENDER Age [1,] 2 45 [2,] 1 58 [3,] 1 54 [4,] 2 71 [5,] 2 64 ... I would like to create an another column which groups the patients wrt Gender specific Age quantiles, following methodology similar to:
Age_group <- cut(Age, labels=c(1:10), breaks=quantile(Age, seq(0,1,.1)),include.lowest = TRUE) The function above allows me to group only wrt Age quantiles. Best, Robert -- View this message in context: http://r.789695.n4.nabble.com/subgroup-based-quantiles-tp4651415.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.