# Interquartile Range (IQR) The IQR is the interquartile range. This is the [[Range]] of the middle 50% of your data. IQR is calculated as such: $(max - median) - (median - min)$ This is because the [[Median]] is the direct center point of the data. So we take the maximum value and subtract that center (the 50%) mark, and that will give us the middle ground which is the 75% mark. We then take the [[Median]] and subtract the minimum value and that will give us the 25% mark. So now that we have both the 75% & 25% marks we can make these 2 values our new min/max values $max(x) - min(x)$ and this will give us the interquartile range The IQR is good for skewed data as it ignores outliers and focuses on the middle of the data ```r # Written Out: (max(x) - median(x)) - (median(x) - min(x)) # To get the quantiles themselves: quantile(x) # Actual R Function: IQR(x) ```