How to Interpret IQR in Statistics With Examples

The interquartile range (IQR) describes how spread out the middle half of a set of numbers is, leaving out the lowest quarter and the highest quarter.1Statistics By Jim. Interquartile Range (IQR): How to Find and Use It It answers a practical question: how much do ordinary values differ from one another, rather than how far the most extreme values reach. That is why reports on things like hospital stays or test scores so often pair a middle value with an IQR instead of an average.

What a Big or Small IQR Tells You

The IQR is measured in the same units as the data, so an IQR of 9 days means 9 days, and an IQR of 12 points means 12 test points. In North Carolina in 2003–2004, the middle half of 4th-grade reading scores on end-of-grade tests covered 12 points, and the middle half of math scores covered 10 points.2PubMed Central. The Relationship between Early Childhood Blood Lead Levels and Performance on End-of-Grade Tests

Take two classes with similar average scores, one with an IQR of 5 points and the other with 25. The narrow class’s students mostly perform alike, while the wide class mixes strugglers and high performers. The IQR says nothing about where the middle sits, only how wide it is, so two datasets can share the same IQR while one is centered near 50 and another near 80. Read it alongside the median to know both the typical level and the consistency.

Researchers can also compare a difference to the IQR to judge whether it is small or large.2PubMed Central. The Relationship between Early Childhood Blood Lead Levels and Performance on End-of-Grade Tests A childhood blood lead level of 5 μg/dL was linked to a drop in reading scores of about 15% of the reading IQR, and 14% of the math IQR.2PubMed Central. The Relationship between Early Childhood Blood Lead Levels and Performance on End-of-Grade Tests The IQR is not the range of all the data, so a wide gap between the minimum and maximum can coexist with a narrow IQR, a pattern that often means most values cluster closely while a few lie far off.

Whether an IQR counts as big depends on the scale. An IQR of 10 is huge on a 1–5 scale but tiny for incomes in dollars. Compare it with the median or with another group measured the same way, because comparing IQRs only makes sense when the units match.

On rating-scale surveys, an IQR under 1 means more than half of the answers fall within 1 point of each other.3PubMed Central. Challenges faced with the implementation of Web-Based Data Query Systems for population health: development of a questionnaire based on expert consensus Expert panels often treat a small IQR on a question as one sign the group has reached agreement.3PubMed Central. Challenges faced with the implementation of Web-Based Data Query Systems for population health: development of a questionnaire based on expert consensus

How to Calculate the IQR Step by Step

The IQR equals Q3 minus Q1.4DISCOVERY: Foundations of AI and Data Science. Quartiles and Box Plots – Data Science Discovery Q1 is the 25th percentile and Q3 the 75th, each cutting off a quarter of the data, which is why they are called quartiles.5JMP. Box Plot The median, the middle value, is the second quartile and splits the data in half.

Here is a worked example with eight numbers:

  • Step 1: Sort the numbers: 2, 4, 5, 7, 8, 10, 12, 15.
  • Step 2: Find the median: halfway between 7 and 8, so 7.5.
  • Step 3: Q1 is the middle of the lower half (2, 4, 5, 7), which is 4.5.
  • Step 4: Q3 is the middle of the upper half (8, 10, 12, 15), which is 11.
  • Step 5: IQR = 11 − 4.5 = 6.5, so the middle half of values spans 6.5 units.

With an odd number of values, the median is one of the actual data points, such as the 4th of 7. Many classroom methods drop that middle value from both halves before finding Q1 and Q3. Q1 is then the middle of the lower half and Q3 the middle of the upper half. Some textbooks keep the median in both halves, so check which convention your course uses.

A few mistakes come up again and again. Forgetting to sort first gives meaningless quartiles. Some students subtract Q1 from the median instead of from Q3. Others mix up the IQR with the full range.

Papers report the IQR either as a single width or as its two endpoints, as in “IQR 4 to 13.” A single width loses where the middle half sits, so giving both quartiles is more informative when space allows.

Reading Median and IQR in Real Reports

In one study of patients admitted by family doctors, the median hospital stay was 8 days with an IQR of 4 to 13 days.6PubMed Central. Length of stay and hospital costs among patients admitted to hospital by family physicians Half of patients stayed between 4 and 13 days. The median is 4 days above Q1 but 5 below Q3, a sign that long stays stretch the upper end. Median hospital costs in that study were $6498, with the middle half between $4035 and $11,313.6PubMed Central. Length of stay and hospital costs among patients admitted to hospital by family physicians

Reports use the median and IQR for stays and costs because a handful of patients staying for months would drag an average far above what most patients experience. The median and IQR describe the ordinary patient and are barely moved by those few.

Comparisons work the same way. A review of COVID-19 hospital stays found a median of 14 days (IQR 10–19) in China versus 5 days (IQR 3–9) elsewhere.7PubMed Central. COVID-19 length of hospital stay: a systematic review and data synthesis The two middle halves barely overlap, so stays differed clearly between the settings. In intensive care, though, the figures were close, 8 (5–13) versus 7 (4–11) days, so typical ICU stays were similar.7PubMed Central. COVID-19 length of hospital stay: a systematic review and data synthesis

Using the IQR to Spot Outliers With the 1.5 Rule

The standard rule labels as unusual any value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR.8Journal of the American Statistical Association. Performance of Some Resistant Rules for Outlier Labeling Such a value, called an outlier, sits far enough from the rest to look out of place. In the sorted list −5, −2, 0, 1, 8, the quartiles are −2 and 1, giving an IQR of 3.8Journal of the American Statistical Association. Performance of Some Resistant Rules for Outlier Labeling The cutoffs, often called fences, are −6.5 and 5.5, so 8 is flagged as an outlier.8Journal of the American Statistical Association. Performance of Some Resistant Rules for Outlier Labeling

To try it on your own data, compute the IQR and multiply it by 1.5. Subtract that from Q1 and add it to Q3, then scan for values beyond either fence. With the earlier worked list of eight numbers, the fences are −5.25 and 20.75, so nothing is flagged.

A larger example has Q1 = 440, Q3 = 786.25 and an IQR of 346.25, which puts the fences at −79.375 and 1305.625.9DEV Community. Percentiles, the IQR and the 1.5 Outlier Rule: How to Flag a Bad Row When the data cannot be negative, a negative lower fence means nothing can be flagged as unusually low. Researchers analyzing student test scores used this rule to drop extreme scores before analysis.10Journal of Applied Developmental Psychology. Improving adolescents’ standardized test performance: An intervention to reduce the effects of stereotype threat

Flagged does not mean wrong. A flagged value might be a typo, a measuring slip, or a real but rare case, so investigate the source of each one before deciding what to do.

Seeing the IQR on a Box Plot

On a box plot, the box runs from the 25th to the 75th percentile.11Simply Psychology. Reading a Box and Whisker Plot The box’s length is the IQR and holds the middle 50% of values.5JMP. Box Plot When two groups’ boxes don’t overlap, that suggests the groups really differ, as with heights of men and women, though it is not a formal test.12University of Southampton. Statistical Analysis

The median line inside the box shows balance. A line near the middle suggests a balanced middle half. A line closer to one edge suggests the data are lopsided, bunched toward that edge and stretched toward the other. In many box plots the whiskers stop at the 1.5 rule fences, and dots beyond them mark flagged values. To compare boxes side by side, compare the median lines for the typical level of each group, and the box lengths for how consistent each group is.

Many students wrongly read a bigger box as meaning more data, carrying over a habit from bar charts.13Educational Studies in Mathematics. Understanding student errors in comparing data sets with boxplots Every box holds the same share, half the data, so a longer box means more spread, not more values.

IQR Versus Standard Deviation and When to Use Each

Standard deviation, a common measure of spread based on distance from the average, is pulled strongly by outliers and long tails, even more than the average is.14Biometrical Journal. Robustness of the Standard Deviation and Other Measures of Dispersion Q1 and Q3 depend only on the order of the values, so extreme values barely affect the IQR.15MetricGate. Standard Deviation vs IQR: Which Spread Measure That makes the IQR preferred for skewed data, messy data, and rating scales where an average itself is questionable.15MetricGate. Standard Deviation vs IQR: Which Spread Measure

Add one billionaire to a town’s list of incomes and the average and standard deviation jump enormously. The median and IQR barely move, because that person is just one more value at the top of the order. This is why income gaps are often described with quartiles.

For a class assignment, plot the data first. If it looks symmetric with no extremes, the mean and standard deviation are fine. Otherwise report the median and IQR. Formulas that estimate a standard deviation from an IQR work well only in a narrow range of sample sizes and can badly overestimate it for skewed data.16PubMed Central. Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range

Why Software Gives Different IQR Values

Running the same data through R, Excel and Python can give three different Q1 values.17PlotNerd. Quartile Calculation Methods Compared: R vs Python vs Excel vs SPSS Each program fills gaps between data values with a different rule, and all are considered correct.17PlotNerd. Quartile Calculation Methods Compared: R vs Python vs Excel vs SPSS R’s help page for its quantile function lists several definitions to choose from.18Stack Overflow. R and Python Give Different Results (Median, IQR, Mean, and STD)

Use the method your course or field expects, and say which software or method you used so others can reproduce your numbers. In the worked example of eight values, a program might give Q1 = 4.75 instead of 4.5, and that is acceptable.

Related Measure, The Semi-Interquartile Range

The semi-interquartile range, also called quartile deviation, is the IQR divided by 2, written (Q3 − Q1)/2.19Statistics How To. Semi Interquartile Range / Quartile Deviation In the worked example, it is 6.5 ÷ 2 = 3.25. Some textbooks call the IQR itself the midspread or middle 50%.20Wikipedia. Interquartile range

It is roughly the typical distance from the median to either quartile, which fits a “plus or minus” style of reporting. Don’t confuse it with the full IQR when comparing reports.