Percentile for Each Observation w/r/t Grouping Variable

后端 未结 7 1236
广开言路
广开言路 2021-02-06 10:39

I have some data that looks like the following. It is grouped by variable \"Year\" and I want to extract the percentiles of each observation of Score, with respect to t

相关标签:
7条回答
  • 2021-02-06 11:27

    Using ave

    ave(d1$scores, d1$year, FUN=function(x) ecdf(x)(x))
    
    0 讨论(0)
提交回复
热议问题