[R] subgroup-based quantiles

R Kozarski r.kozarski at gmail.com
Fri Nov 30 13:18:36 CET 2012


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.



More information about the R-help mailing list