Questions tagged [quantile]

Quantiles are points taken at regular intervals from the cumulative distribution function (CDF) of a random variable.

In scientific software for statistical computing and graphics, the quantile of a numeric vector can be found by function quantile.

755 questions
-1
votes
1 answer

Scala: Class that is similar to QuantileTransformer in python

I am looking for a Scala implementation of Python's sklearn.preprocessing.QuantileTransformer class. There doesn't seem to be a single Class that can implement the entire functionality in scala. The Python implementation has 3 major parts: 1)…
-1
votes
1 answer

d3 get quantile on array of object

I am trying to get the first quartile, the median and last quartile of an array of object base on their value. 0: Object { key: "Aeronautical, Mechanical, Chemical and Manufacturing Engineering", value: 0.6100000000000001 } 1: Object { key:…
Boat
  • 509
  • 3
  • 8
  • 21
-1
votes
1 answer

How to simulate BigQuery's quantiles in Hive

I want to simulate BigQuery's QUANTILES function in Hive. Data set: 1,2,3,4 BigQuery's query result will return value 2 select nth(2, quantiles(col1, 3)) But in Hive: select percentile(col1, 0.5) I've got 2.5 Note: I've got same result for odd…
goRunToStack
  • 253
  • 2
  • 9
-1
votes
1 answer

Subset dataset to 99.5th percentile for each of a categorical variable

I want to subset a data.frame to keep only the 99.5th percentile of each of a categorical variable. My data has minutes used = minutes And location = location I would like to take out the top .5 percent of minutes data for each location. The new…
George
  • 3
  • 1
-1
votes
2 answers

Create quantile for each subcategory

I have a dataset like the following Student|School|Marks a|DPS |47 b|DPS |54 c|DPS |34 d|DPS |67 e|DPS |96 f|DPS |53 g|DPS |83 h|DPS |75 i|DPS |87 j|DPS |91 k|KV …
aman
  • 151
  • 1
  • 7
-1
votes
1 answer

Obtain the cut2 interval for numbers not previously included

Actually, I have solved this question, but I have problems because the solution is in two steps, which are really separated between each other (the first step is inside a function and the second step is inside another; this would imply me to make H…
-1
votes
1 answer

Binning data in Python

I'm working very hard to understand how to bin data in Python. So far I have worked out how to get the edges using: edges = pylab.hist(data, bins=10)[1] I'm not sure if this is the most ideal method, but it worked! Gives me a list of 11 numbers…
user3023715
  • 1,539
  • 2
  • 11
  • 12
-1
votes
1 answer

Compare variable to its yearly quartile values and create rankorder variable

I am trying to find a fast way to do the following: Determine the yearly quartile values of a database Compare (match) a specific variable in a database to its yearly quartile value Depending on the value, create a new variable with value of…
SJDS
  • 1,239
  • 1
  • 16
  • 31
-1
votes
1 answer

R - how to show mean, median, standard deviation, quantiles in boxplot

Is there a way I can show the "five values" in a boxplot by using R? p0.3 = dbinom(0:60, 60, 0.3) p0.5 = dbinom(0:60, 60, 0.5) p0.8 = dbinom(0:60, 60, 0.8) boxplot(p0.3,p0.5,p0.8, names=c("0.3","0.5","0.8"),col=c("red","yellow","blue"),main =…
Dido Du
  • 1
  • 4
-1
votes
2 answers

Quantiles in Matlab

Would there be a function in matlab, or an easy way, to generate the quantile groups to which each data point belongs to? Example: x = [4 0.5 3 5 1.2]; q = quantile(x, 3); ans = 1.0250 3.0000 4.2500 So I would like to see the…
Mayou
  • 8,498
  • 16
  • 59
  • 98
-2
votes
1 answer

How to Repeat the Same Task Across 30 Data Frames - Python Pandas

I have the following data frame (called aa1): d = {'Index' : pd.Series([25, 7, 7, 5, 5, 8])} aa1 = pd.DataFrame(d) I created a new column called Quartile_Index that scores the quartile for the Index column values (note: this was the best solution I…
Ulises Sotomayor
  • 159
  • 2
  • 14
-2
votes
1 answer

How to detect values in table's column and subtract them to another column?

Data I'm working with data.table and I'm trying to make a quite difficult manipulation. My data looks like this: A <- data.table(c("a","a","b","c","d","d"),c(1,2,2,3,4,9),c(1,1,0,0,7,3)) V1 V2 V3 1: a 1 1 2: a 2 1 3: b 2 0 4: c 3 0 5:…
Orhan Yazar
  • 909
  • 7
  • 19
-2
votes
1 answer

Quantiles in R for above an upper percentage

Any ideas on how to calculate the quantile of a sample data that are at or above the upper 1%? From what I understand quantile(X, 0.99) will bring me the value of the sample that the 99% is below it. Thanks
Saraki
  • 297
  • 1
  • 7
  • 21
-2
votes
1 answer

How to avoid auto-merge of Deciles in R?

I am new to R, and I've been facing this problem from quite some time. Whenever I try to make deciles or quartiles using 'dplyr' package, my deciles get merged into fewer groups. Like I want 10 different groups, whereas I only get 6, 4 or sometimes…
PerryThePlatipus
  • 61
  • 1
  • 1
  • 5
-2
votes
1 answer

Different mean values from mean(quantile ()) and mean() in R

I am using the "quantile" function of R for calculating the percentiles of my dataset. But i am confused due to the different mean values returned by following commands. mean(quantile(DataSet$V3, prob=c(5,50,95)/100,type=8)); It gives me…
Zack
  • 11
  • 3
1 2 3
50
51