Questions tagged [iqr]

IQR stands for "Interquartile range" in statistics.

Interquartile range (statistics) equals to the difference between the third and first quartiles. A really nice alternative to show dispersion instead of standard deviation.

This descriptive statistic could be familiar from boxplots.

75 questions
0
votes
1 answer

How to detect and remove outliers within loop in R?

Hope someone can send help for a desperate student :-) I have a set of procedure codes for which I have a different number of surgeries (here: procedures) with their respective durations. I would like to get some descriptive statistics on the…
Kaya
  • 115
  • 6
0
votes
1 answer

R Error in names(x) <- value depending on range box plots in a loop

I have a large dataset with 270 columns and 17392 rows. Of those 270, I need to select 235. The rows can be grouped by 'Site' , which is a unique numeric value (e.g., 1, 2 etc - 111 different Sites in total). Each of the column constitute a…
0
votes
1 answer

How to get the IQR for each value in python

Data is below (df) id,cost,spend 1,123456,281257 2,150434,838451 3,100435,757565 4,650343,261071 5,-454236,275760 6,-547296,239225 How to get the IQR for each value output >> id,cost,cost_IQR,spend,spend_IQR For Z score below is my code cols =…
aysh
  • 493
  • 1
  • 11
  • 23
0
votes
0 answers

How to find the IQR in the data set using pandas

Dataset is below ,store id,revenue ,profit 0,101,779183,281257 1,101,144829,838451 2,101,766465,757565 3,101,353297,261071 4,101,1615461,275760 5,101,246731,949229 6,101,951518,301016 7,101,444669,430583 Code is below import pandas as pd import…
user6882757
0
votes
1 answer

How to obtain values (e.g. median) from a boxplot in r?

I’ve plotted a boxplot for PM2.5 levels per year. Boxplot(PM2.5~year, data=subset(dat, hour==12), las=1) How can I extract values such as the median from the boxplots?
Kai Whelan
  • 13
  • 1
0
votes
1 answer

Finding outliers in python with the IQR Method excluding the median

I'm looking to calculate the 1st and 3rd quartile of a small data set to determine the outliers: 6000 13500 15000 15000 17948 While the calculation is fairly simple in theory, I find that python uses a different approach than the one I want (and the…
Marius
  • 1
  • 1
0
votes
1 answer

Why the Q1 and Q3 is different from what I think?

I have a very confusing question about quantile. I have a sample here and its Q1 and Q3 should be like this: But when I summary the vector in R I got a different result: summary(A) #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 1.00 …
Chris
  • 87
  • 10
0
votes
1 answer

Splitting Data with query to calculate formulas only works on one column

I have data sheets that I am giving more data set area for future data if need be. I have multiple formulas that work when its using only one column thats in the range. If the range is more than one column but data is in the first column it gives an…
0
votes
0 answers

boxplot: constant iqr over time

My sample is a panel data set, consisting of several variables and several time periods. i detect and treat outliers with the iqr method. that is, outliers are observations above/below the third/first quartile plus/minus 1.5 times the iqr. as…
Mimi
  • 9
  • 1
0
votes
0 answers

How to find the robust sigma of values in a column and then find the upper and lower limits?

So, I have data which looks like this: BatchID UnitID Score Median 0 A123 A123-100 0.111 0.1065 1 A123 A123-101 0.121 0.1065 2 A123 A123-102 0.101 0.1065 3 A123 A123-103 0.102 0.1065 4 B456 B456-200 0.211 0.2160 5…
azura
  • 81
  • 5
0
votes
1 answer

How to group rows by ID and calculate mean and IQR

I have a long format dataframe,my data, where there are 101 participants who each receive a score on 51 trials (Event), like so: dput(head(mydata, 200)) `structure(list(Participant = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
user72716
  • 263
  • 3
  • 22
0
votes
0 answers

Oracle Sample Count for different time periods

This might be a very basic question so apologies in advance. I need number of samples from last 3 months, 6 months, 1 year, 2 years etc. and depending on if I have enough samples,(I'm trying to collect enough no. of samples by going back in history,…
blaucuk
  • 125
  • 1
  • 10
0
votes
2 answers

How to use IQR outlier function, based on a key, in R

I want to use this IQR function: smooth_outliers <- function(x, na.rm = TRUE, ...) { qnt <- quantile(x, probs=c(.25, .75), na.rm = na.rm, ...) H <- 1.3 * IQR(x, na.rm = na.rm) y <- x y[x < (qnt[1] - H)] <- round(qnt[1] - H) y[x >…
Matan Retzer
  • 65
  • 1
  • 7
0
votes
1 answer

R: Cluster data sample and remove datapoints lying outside the 1.5*Interquartile range

I have a large set of trading data with apx 15 mio. lines in the followig form: mydata_tsample Size TradingCost 10000 80 2733000 79.343 750000 78.125 750000 77.875 150000 83.875 105000 86.875 105000 87.20 …
Brian
  • 45
  • 4
0
votes
2 answers

compute IQR for each column in data.frame

I am quite new to R therefor my question might be quite basic but searching through the forum I haven't really found the write answer. I have a data.frame of 24 variables and after computing the mean for each column I would like to calculate the…
Tobias Tobi
  • 1
  • 1
  • 2