quantile

Is there an easy way to calculate quantiles with bash?

Lets say I have a log file from a web server with response times per request: _1st_request 1334 _2nd_request 345 _3rd_request 244 _4th_request 648 ......... etc Is there an easy way with bash scripting to find the top decile (10-quantile)? In other words to answer the question: How slow was the slowest request if I exclude the slowest...

Calculating Percentiles (Ruby).

My code is based on the methods described here and here. def fraction?(number) number - number.truncate end def percentile(param_array, percentage) another_array = param_array.to_a.sort r = percentage.to_f * (param_array.size.to_f - 1) + 1 if r <= 1 then return another_array[0] elsif r >= another_array.size then return anothe...

R:lattice.qq How do I do a multi-panel plot of treatment[x] vs control?

I have a dataframe that looks like this: str(Data) 'data.frame': 11520 obs. of 29 variables: $ groupname : Factor w/ 8 levels "Control","Treatment1",..: 1 1 1 1 1 1 1 1 1 1 ... $ fCycle : Factor w/ 2 levels "Dark","Light": 2 2 2 2 2 2 2 2 2 2 ... $ totdist : num 0 67.5 89.8 109.1 58.3 ... #etc. I can do a single plot o...

Sorted quantile mean via Rpy

The real goal here is to find the quantile means (or sums, or median, etc.) in Python. Since I'm not a power user of Python but have used R for a while, my chosen route is via Rpy. However, I ran into the problem that the returned list of means are not correspondent to the order of the quantiles. In particular, I have the followings in R...

Is there a better way to create quantile "dummies" / factors in R?

Hi all, i´d like to assign factors representing quantiles. Thus I need them to be numeric. That´s why I wrote the following function, which is basically the answer to my problem: qdum <- function(v,q){ qd = quantile(v,1:(q)/q) v = as.data.frame(v) v$b = 0 names(v) <- c("a","b") i=1 for (i in 1:q){ if(i == 1) v$b[ v$a < ...