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
0
votes
1 answer

Laravel Eloquent How to get 1st and 3rd quartile on php?

I'm trying to find outliers using the 1st and 3rd quartile. This is what I have currently: $data = Data::select('created_at', 'value') ->get(); $median = collect($data)->median("value");
Jay Lee
  • 1
  • 1
0
votes
1 answer

Calculating LQ, UQ and IQR in SQL for grouped data

I'm struggling to work out how I would get the upper/lower quartiles and IQR for grouped data in SQL. Say I have some data similar to below: ID Data 1 21 1 37 1 86 1 1 1 34 1 77 2 5 2 15 2 29 3 12 3 …
Emi OB
  • 2,814
  • 3
  • 13
  • 29
0
votes
1 answer

R Mean of multiple groups by quartiles

I have a dataframe with different variables, e.g.: x1, x2 and so on. I created quartiles based on one variable (BE) with the following code: Quantile_Var <- Var%>% mutate(Quartile = ntile(BE, 5)) Now I want to see the means of each variables (x1,…
0
votes
1 answer

Coefficient of Quartile Variation in R

I am trying to calculate the coefficient of quartile variation in R for every 3 consecutive measurements. cqv_versatile( Q, na.rm = TRUE, digits = 3) Q 49 44 34 33 37 48 20 48 37 42 44 …
Jacs
  • 1
0
votes
1 answer

Labelling quartiles in the Boxplot using R

I was plotting the Boxplot and labelling it with quartiles and min-max values. It worked fine for a few columns; however, for some columns, the stats value was not exactly matching with the boxplot stats. For example, the summary command was giving…
0
votes
2 answers

Assign label in new column based on quartile range of values

I'm attempting to label values based on a quartile range of one column in my dataset, but am having trouble synthesizing two steps. Here's a toy dataset below: fruit rating_store rating_home apple 1.0 .8 pear .8 …
psychcoder
  • 543
  • 3
  • 14
0
votes
2 answers

Excel Quartile function in SQL Server SQL Query

I have an set of values like this: 40 50 50 66 83 100 100 100 100 100 100 100 100 100 100 100 100 When I do the quartile function in excel, i get these four values for my first quartile (25), second quartile(50), third quartile(75) and max…
0
votes
1 answer

Finding the quarter value in data values using standard sql bigquery

I would like to have Q1 and Q3 for the frequency column using standard sql. Table name : table.frequency Sample data: What I did is: SELECT (ROUND(COUNT(frequency) *0.25)) AS first_quarter, (ROUND(COUNT(frequency) *0.75)) AS third_quarter FROM…
nsw
  • 9
  • 6
0
votes
2 answers

(Oracle)Getting 25th number using interpolating

My goal is to get 25th number. For instance I have 4 row, such as 3,4,5 and 7. My goal is to get 1.25th(=(4+1)0.25). Expected result is 3.25 which is obtained by interpolating(3+0.25(4-3)). I have tried as below. But is there any other efficient…
Soon
  • 491
  • 3
  • 16
0
votes
0 answers

Getting a fatal error when using a quartile function

Here is the code I am using:
0
votes
1 answer

cox proportional hazard regression in SPSS using reference group

I am running cox proportional hazard regression in SPSS to see the association of 'predictor' with risk of a disease in a 10 years follow-up. I have another variable 'age_quartiles' with values 1,2,3,4 and want to use '1' as reference to get HRs for…
Tabbi
  • 69
  • 1
  • 9
0
votes
1 answer

PHP function to calculate percentiles of array - doesn't give the correct result

I'm using this function (from https://stackoverflow.com/a/46227341/10495991) to calculate the 25th percentile of an arrary: function getPercentile($array, $percentile) { $percentile = min(100, max(0, $percentile)); $array =…
Milo
  • 5
  • 2
0
votes
2 answers

Replace values on dataset and apply quartile rule by row on pandas

I have a dataset with lots of variables. So I've extracted the numeric ones: numeric_columns = transposed_df.select_dtypes(np.number) Then I want to replace all 0 values for 0.0001 transposed_df[numeric_columns.columns] =…
Catarina Nogueira
  • 1,024
  • 2
  • 12
  • 28
0
votes
1 answer

quartile python collections Counter

I have the following list that records the count frequency of random objects: counter_obj= [('oranges', 66), ('apple', 13), ('banana', 13), ('pear', 12), ('strawberry', 10), ('watermelon', 10), ('avocado', 8) ...…
Troy
  • 19
  • 5
0
votes
2 answers

Using R to Bin Data into Quartiles

I am write a very simple if else loop to create a new variable that bins another variable into quartiles. This seems to be a very simple procedure, however the loop groups all of my data into the median and third quartile (which violates the…
benalbert342
  • 71
  • 1
  • 4