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
4
votes
4 answers

How to plot quantil band (in R)

I have a CSV file which contains lines for each (Java GC) Event I am interested in. The object consists of a subsecond timestamp (non equidistant) and some variables. The object looks like this: gcdata <-…
eckes
  • 10,103
  • 1
  • 59
  • 71
3
votes
1 answer

Unexpected result when using quantile in Julia vs Python

I've just started with Julia and I am trying to do some simple statistics. I'm using the StatsBase package and am trying to calculate quantiles. using StatsBase lst = 1:10 print(nquantile(lst, 4)) and get [1.0, 3.25, 5.5, 7.75, 10.0] Where I…
3
votes
1 answer

How to use percentile_conts with multiple quantiles in Postgres

I currently have a query that works like so: select AVG(t2 - t1) as delay, percentile_cont(0.25) within group (order by (t2 - t1)) as q25, percentile_cont(0.5) within group (order by (t2 - t1)) as median, percentile_cont(0.75)…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
3
votes
3 answers

pandas - replace values with percent of observations that are below/less

I have a df like this: >>> a = [1, 2, 3, 4, 5, 6, 7, 8] >>> df = pd.DataFrame({'a': a}) >>> df a 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 I would like to replace these values with values that shows how many of the observations are less than the…
777moneymaker
  • 697
  • 4
  • 15
3
votes
1 answer

Percentile rank in pyspark using QuantileDiscretizer

I am wondering if it's possible to obtain the result of percentile_rank using the QuantileDiscretizer transformer in pyspark. The purpose is that I am trying to avoid computing the percent_rank over the entire column, as it generates the following…
Galuoises
  • 2,630
  • 24
  • 30
3
votes
2 answers

Quantile regression and p-values

I am applying guantile regression for my data-set (using R). It is easy to produce the nice scatterplot-image with different quantile regression lines (taus <- c(0.05,0.25,0.75,0.95)). Problem occurs when I want to produce p-values (in order to see…
Johannainen
  • 31
  • 1
  • 2
3
votes
2 answers

PANDAS Quantiles different answer depending on how we ask it

New take on a problem from two days ago. When you have a big set of data, PANDAS can let you filter things in-place while generating statistics, so you don't have to make new dataframes for everything. Right now, I suspect there's a nuance to doing…
3
votes
1 answer

Pandas - get values on a graph using quantile

I have this df_players: # Column Non-Null Count Dtype --- ------ -------------- ----- 0 TableIndex 739 non-null object 1 PlayerID 739 non-null int64 2 GameWeek 739 non-null int64 …
8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198
3
votes
2 answers

numpy.quantile and statistics.quantiles are calculating different. which one is true?

So, assume we have an array like that: 4,6,9,10,2,25,12,6,9 And then I try to calculate quantiles with numpy.quantile and statistics.quantile import numpy as np from statistics import quantiles arr =…
ryilkici
  • 83
  • 2
  • 6
3
votes
2 answers

Calculating piecewise quantile linear regression with segmented package R

I am looking for a way to obtain the piecewise quantile linear regression with R. I have been able to compute the Quantile regression with the package quantreg. However, I don't want just 1 unique slope but want to check for breakpoints in my…
D_CodeO1
  • 43
  • 5
3
votes
1 answer

geom_quantile full range in ggplot2

Is there a way how to set full_range = T parametr somehow in ggplot? library(ggplot2) ggplot(mtcars, aes(hp, disp)) + geom_point() + #geom_smooth(method = "lm", aes(group = factor(gear), color = factor(gear)), fullrange = T) …
Petr
  • 1,606
  • 2
  • 14
  • 39
3
votes
2 answers

How to convert string into aggregated quantiles?

I have a dataframe that is nested by groups. I want to convert variable 'x' from its raw value to quantile position (20%, 40%, 60%, 80%, 100% or 1, 2, 3, 4, 5). Here is an example of the data I'm using: df <- data.frame(x=c(1, 5, 21, 24, 43, 47, 56,…
Marco Pastor Mayo
  • 803
  • 11
  • 25
3
votes
4 answers

How to create a boxplot with customized quantiles in R?

I am now dealing with some data and I want to make a boxplot showing minimum, 2.5, 25, 50, 70, 75, 97.5, and maximum. The boxplot should also have a legend showing lines with different colors to represent each quantile. Is there any way to do this?…
Yang Yang
  • 858
  • 3
  • 26
  • 49
3
votes
1 answer

How does pandas quantile( ) function works internally?

In this post: How does pandas calculate quartiles? This is the explanation given by @perl on the working of quantile() function: df = pd.DataFrame([5,7,10,15,19,21,21,22,22,23,23,23,23,23,24,24,24,24,25], columns=['val']) Let's consider 0.25 (same…
vineet
  • 31
  • 4
3
votes
1 answer

How to calculate the numbers of the observations in quantiles?

Consider I have a million of observations following Gamma distribution with parameters (3,5). I am able to find the quantiles using summary() but I am trying to find how many observations are between each red lines which were divided into 10…
Justin
  • 374
  • 1
  • 3
  • 9