search for: rankit2

Displaying 1 result from an estimated 1 matches for "rankit2".

Did you mean: rankits
2011 Oct 21
1
replicating SAS's "proc rank" procedure
Hi try this function ive written it should be self explantory but let me know if you have any problems. I've only been using R for a few eeeks so apologies if its not the most efficient! rankit2<-function(rankvar,cuts,data,factor) { ranker<-rankvar ranker<-0 range<-c(1:cuts) range2<-range/cuts range3<-quantile(factor,range2) over<-length(factor) for (i in 1:over){ for (j in 1:cuts) { if (data[[i,1]]<=range3[[j]]) {data[[i,3]]<-j ##test<-j ##print(j) } i...