Questions tagged [quartile]

Quartiles are the values that divide a list of numbers into quarters.

Quartiles are the values that divide a list of numbers into quarters.

Further reference: https://www.mathsisfun.com/data/quartiles.html

115 questions
11
votes
1 answer

Quartiles line properties in seaborn violinplot

trying to figure out how to modify the line properties (color, thickness, style etc) of the quartiles in a seaborn violinplot. Example code from their website: import seaborn as sns sns.set(style="whitegrid") tips = sns.load_dataset("tips") ax =…
Red Sparrow
  • 387
  • 1
  • 5
  • 17
7
votes
1 answer

Google BigQuery APPROX_QUANTILES and getting true quartiles

According to the docs: Returns the approximate boundaries for a group of expression values, where number represents the number of quantiles to create. This function returns an array of number + 1 elements, where the first element is the approximate…
Tyler_1
  • 176
  • 1
  • 2
  • 11
6
votes
2 answers

Add horizontal quantile lines to scatter plot ggplot2 R

I have eg data below eg_data <- data.frame( period = c(sample( c("1 + 2"), 1000, replace = TRUE)), max_sales = c(sample( c(1:10), 1000, replace = TRUE, prob = c(.05, .10, .15, .25, .25, .10, .05, .02, .02, .01))) I want to make a scatter (jitter,…
Adam_S
  • 687
  • 2
  • 12
  • 24
6
votes
2 answers

Calculating percentiles in SQL

This should be very straightforward, but as a newbie to SQL I am really struggling. I've been recommended to use PERCENTILE_CONT with continuous (non-discrete) data. The data in question concerns two columns: (1) the IDs for a list of patients and…
user518206
  • 93
  • 1
  • 1
  • 7
5
votes
1 answer

Associating colors from a continuous colormap to specific values in matplotlib

I am trying to find a way to associate certain data values to specific colors in a continuous colormap. I have a certain image with values ranging from [min, max], and I would like the following values [min, q1, q2, q3, max], where q'n' refers to…
marcos
  • 134
  • 15
4
votes
3 answers

Pandas Getting Upper and Lower Fences For Each Rows

My input dataframe is; Grp A B C Men 10 15 20 Women 15 10 25 Baby 5 10 20 Men 3 8 25 Men 7 5 30 Baby 5 …
Salih
  • 719
  • 1
  • 6
  • 12
4
votes
1 answer

Use R to calculate median without replicating elements

I have a frequency distribution with huge numbers. I want to calculate median and quartiles but R complains. Here is what is working for small numbers: > TABLE <- data.frame(DATA = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19), F =…
meolic
  • 1,177
  • 2
  • 15
  • 41
3
votes
2 answers

How to calculate quartiles grouped by?

Let's say I have a table VAL PERSON 1 1 2 1 3 1 4 1 2 2 4 2 6 2 3 3 6 3 9 3 12 3 15 3 And I'd like to calculate…
Johnny Bigoode
  • 578
  • 10
  • 31
3
votes
1 answer

Why this CSV data complicates with ggplot2 whisker plot?

I can reproduce a working ggplot2 boxplot with the test data but not with CSV data in R. Data visually with single point about the events (sleep and awake) "Vars" , "Sleep", "Awake" "Average" , 7 , 12 "Min" , 4 , 5 "Max" , 10 …
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
3
votes
2 answers

Which method does pandas use for percentile?

I was trying to understand lower/upper percentiles calculation in pandas and got a bit confused. Here is the sample code and output for it. test = pd.Series([7, 15, 36, 39, 40, 41]) test.describe() output: I am interested in only 25%, 75%…
Natig Aliyev
  • 379
  • 6
  • 18
3
votes
1 answer

Continuous quantiles of a scatterplot

I have a data set, for which I graphed a regression (using ggplot2's stat_smooth) : ggplot(data = mydf, aes(x=time, y=pdm)) + geom_point() + stat_smooth(col="red") I'd also like to have the quantiles (if it's simpler, having only the quartiles…
François M.
  • 4,027
  • 11
  • 30
  • 81
3
votes
2 answers

Obtaining nice cuts in Hmisc with cut2 (without the [ ) signs )

I'm currently trying to neatly cut data with use of the Hmisc package, as in the example below: dummy <- data.frame(important_variable=seq(1:1000)) require(Hmisc) dummy$cuts <- cut2(dummy$important_variable, g = 4) The produced cuts are correct…
Konrad
  • 17,740
  • 16
  • 106
  • 167
2
votes
1 answer

Python boxplot size of the IQR from 50% to 70%

I would like to know if it's possible to put 70% of the population in the boxplot as in the red one? I know that Q3 - Q1 = IQR but don't know how this can help me. I'm using matplotlib to draw my boxplot. def…
2
votes
1 answer

How can I interpret the pandas quartiles?

I have a pandas datafram df with a column A. The values of A are based on predictions and I've forced them to be greater or equal to 0.00000001. Now when I run df.A.describe() I get: count 3.900000e+02 mean 1.047049e-05 std …
jjunk
  • 87
  • 5
2
votes
1 answer

Matplotlib boxplot select method to calculate the quartile values

Using boxplot from matplotlib.pyplot the quartile values are calculated by including the median. Can this be changed to NOT include the median? For example, consider the ordered data set 2, 3, 4, 5, 6, 7, 8 If the median is NOT included, then…
John
  • 1,645
  • 2
  • 17
  • 29
1
2 3 4 5 6 7 8