search for: quintilesvolbymonth

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

2013 Apr 06
1
Creating quintiles on monthly basis
...works in some cases and often gives the following error: Error in cut.default(df$VOLATILITY, unique(breaks), label = FALSE, na.rm =TRUE): invalid number of intervals Could you give me some advice on how to improve this code so that it works properly. It's relatively urgent. Many thanks! quintilesVolByMonth <- function(x){ months<-as.vector(unique(x$DATE)) dfx<-data.frame() for(n in seq(1,length(months))){ num<-5 print(paste("Appending month",months[n],sep="")) df<-subset(x,DATE==months[n]) breaks<-quantile(df$VOLATILITY,probs=seq(0,...