Concept Architecture
Interquartile Range for Skewed Costs and Outcomes
The interquartile range (IQR) is the distance between the lower quartile and the upper quartile of a set of ordered values, so it measures how far apart the central half of patients sit. In health economics it appears most often as "median (IQR)" in trial and cohort reports of costs, resource use, length of stay and utility values, where a few very expensive or very ill patients would stretch the standard deviation. Because it ignores the lowest and highest quarters of the data, the IQR is stable when the tails are long, but it says nothing about the mean on which budgets and cost-effectiveness ratios rest. Its main uses are describing skewed data, screening for unusual patients and, with care, recovering approximate means for evidence synthesis.
Quartiles and the central half of the data
In sorted data, about a quarter of the values lie below the lower quartile and about three quarters below the upper quartile. The NIST/SEMATECH e-Handbook of Statistical Methods defines the interquartile range as the value of the 75th percentile minus the value of the 25th percentile, and describes it as a measure of the variability of points near the centre.
where is the interquartile range, is the lower quartile (25th percentile) and is the upper quartile (75th percentile). It is in the units of the data, GBP for costs and days for a hospital stay.
The IQR pairs with the median as the standard deviation and variance pair with the mean. The NIST handbook contrasts the range, which uses only the two most extreme points, with the IQR, which uses only the middle portion of the data, and adds that for data with extreme values in the tails the IQR can give a more stable estimate of spread than the standard deviation. The price is efficiency. NIST notes that the IQR keeps valid interval coverage under non-normal data, yet its intervals tend to be wider than the best achievable when the true shape of the distribution is known.
For a normal distribution the upper quartile lies 0.6745 standard deviations above the mean, so the IQR is about 1.349 standard deviations wide. The Cochrane Handbook rounds this to 1.35 for large, near-normal samples.
Why software gives different quartiles
Sample quartiles are not unique. Hyndman and Fan, reviewing sample quantiles in statistical packages, observed that one package may use one definition to compute a quantile and others when drawing a boxplot, and they recommended the median-unbiased estimator as a standard. The R quantile function implements the nine algorithms they discussed, uses type 7 by default, and notes that type 6 is used by Minitab and SPSS.
| Tool | Function or setting | Position of the lower quartile in n sorted values |
|---|---|---|
| R | type 7 (default) | 1 + 0.25(n minus 1) |
| R, Minitab, SPSS | type 6 | 0.25(n + 1) |
| R | type 8 (Hyndman and Fan recommendation) | 0.25(n + 1/3) + 1/3 |
| Excel | QUARTILE.INC | matches type 7 on Microsoft's example |
| Excel | QUARTILE.EXC | matches type 6 on Microsoft's example |
A position between two sorted values is resolved by linear interpolation. Microsoft's help pages give 3.5 and 15 as lower quartiles in their QUARTILE.INC and QUARTILE.EXC examples, which are the type 7 and type 6 results for those data. In large samples the choice barely matters, but in a small subgroup it can change the IQR substantially, as the worked example shows, so methods sections should name the definition.
Median and IQR in cost, stay and utility reporting
Reporting guidance treats the IQR as a descriptive statistic for asymmetric data. The CONSORT 2010 explanation and elaboration paper says that for asymmetrically distributed continuous data a preferable approach may be to quote the median and a centile range such as the 25th and 75th centiles, and that standard errors and confidence intervals are inferential and do not describe variability.
Health economic reports follow the same pattern for average length of stay, visit counts and costs. Thompson and Barber reproduce a table from a hospital at home trial in which three-month general practitioner costs for hip replacement patients were given as median (IQR), GBP 42.84 (0 to 64.61) for 36 patients at home and GBP 15.49 (0 to 45.19) for 49 inpatients, and compared with a Mann-Whitney U test (P = 0.06). A lower quartile of zero shows that roughly a quarter or more of each group had no recorded general practitioner cost. Thompson and Barber cite this as confused practice, since hospital costs in the same table were compared as arithmetic means.
Thompson and Barber's wider point, that budgets scale with the arithmetic mean, limits what the IQR can do in an economic evaluation. A median with its IQR describes a typical patient and the spread around that patient, and the page on descriptive statistics shows how far the mean and median of skewed costs can sit apart.
Utility data show a different use. Where many respondents report full health, an upper quartile equal to 1 shows that roughly a quarter or more of the sample sit at the top of the scale, a pattern the standard deviation would hide. For a health state utility value used in a model, the mean still carries the calculation, and the quartiles act as a check on the shape.
Fences for flagging unusual patients
The IQR also scales a simple screen for extreme values. The NIST handbook defines inner fences at the lower quartile minus 1.5 times the IQR and the upper quartile plus 1.5 times the IQR, and outer fences at 3 times the IQR on each side. A point beyond an inner fence is a mild outlier and a point beyond an outer fence is an extreme outlier.
where and are the lower and upper fences, and are the lower and upper quartiles, is the interquartile range and is 1.5 for inner fences or 3 for outer fences.
For costs, the lower fence is often below zero, so only the upper tail can be flagged. A patient beyond the upper fence is often a genuine high user, such as someone with a complication, and should be checked for data errors. Removing real high users would lower the mean and the budget, so the fences guide data checking and the choice of a skewed distribution such as the gamma distribution or the log-normal distribution, and they do not justify exclusion.
Converting median and IQR for meta-analysis and model inputs
A meta-analysis of a continuous outcome usually needs a mean and standard deviation from each study, yet many studies report only the median and IQR. The Cochrane Handbook notes that reporting IQRs rather than standard deviations often indicates a skewed outcome, and states that outside large, near-normal samples, especially when the data are skewed, a standard deviation cannot be estimated from an IQR.
Wan and colleagues proposed estimators for the case where only the quartiles, the median and the sample size are known. The mean estimator uses the three quartiles alone, while the standard deviation estimator has a divisor that depends on the sample size.
where is the estimated sample mean, is the estimated sample standard deviation, and are the lower and upper quartiles, is the median, is the sample size, is a divisor tabulated exactly for small samples and tending to 1.349, and is the inverse standard normal distribution function. For a missing mean, the Cochrane Handbook reports that the Wan formula and one by Bland assume normal outcomes but have performed well with skewed outcomes in simulation, the Wan method better. Wan and colleagues leave open how far such estimates make sense for very asymmetric data.
Decision models meet the same problem when a cost or length of stay is published only as median (IQR). A probabilistic sensitivity analysis needs a mean and its standard error, and the IQR describes variation between patients, so it cannot stand in for the standard error.
Worked example with nine annual patient costs
All numbers in this example are illustrative. A small audit of a community service records annual health care costs for nine patients, sorted in GBP as 800, 1,000, 1,200, 1,500, 1,900, 2,400, 3,100, 4,500 and 9,000.
1. Centre. The costs sum to GBP 25,400, so the mean is 25,400 / 9 = GBP 2,822.22. The median is the fifth sorted value, GBP 1,900.
2. Quartiles by three definitions. Leaving the median out, the lower half is 800, 1,000, 1,200 and 1,500 and the upper half is 2,400, 3,100, 4,500 and 9,000. Their medians are (1,000 + 1,200) / 2 = GBP 1,100 and (3,100 + 4,500) / 2 = GBP 3,800, so the IQR is 3,800 minus 1,100 = GBP 2,700. Type 6 (QUARTILE.EXC) places the quartiles at positions 0.25 × 10 = 2.5 and 0.75 × 10 = 7.5 and gives the same GBP 1,100 and GBP 3,800. Type 7 (QUARTILE.INC) uses positions 1 + 0.25 × 8 = 3 and 1 + 0.75 × 8 = 7, which are GBP 1,200 and GBP 3,100, an IQR of GBP 1,900. Type 8 uses positions 2.667 and 7.333 and gives 1,000 + 0.667 × 200 = GBP 1,133.33 and 3,100 + 0.333 × 1,400 = GBP 3,566.67, an IQR of GBP 2,433.33.
3. Fences. With the GBP 2,700 IQR, 1.5 × 2,700 = 4,050, so the inner fences are 1,100 minus 4,050 = minus GBP 2,950 and 3,800 + 4,050 = GBP 7,850. The GBP 9,000 patient is a mild outlier. The outer fence is 3,800 + 3 × 2,700 = GBP 11,900, so the patient is not an extreme outlier. With the type 7 IQR the upper inner fence is 3,100 + 1.5 × 1,900 = GBP 5,950, and the same patient is flagged.
4. Spread. The sample standard deviation of the nine costs is GBP 2,595.08. The normal rule gives 2,700 / 1.35 = GBP 2,000. For n = 9 the tabulated Wan divisor is 1.144, giving 2,700 / 1.144 = GBP 2,360.14, although Wan and colleagues derive it for the third and seventh sorted values, the type 7 quartiles, which give 1,900 / 1.144 = GBP 1,660.84. The Cochrane skew check, the mean minus the lowest possible cost of zero divided by the standard deviation, is 2,822.22 / 2,595.08 = 1.09, and the Handbook treats a ratio below 2 as suggesting skew.
5. Rebuilding the mean. The Wan estimate is (1,100 + 1,900 + 3,800) / 3 = GBP 2,266.67, which is GBP 555.56 or 19.7% below the true mean of GBP 2,822.22. For 500 patients a year the true budget is 500 × 2,822.22 = GBP 1,411,111, while the rebuilt mean gives 500 × 2,266.67 = GBP 1,133,333, a shortfall of GBP 277,778.
6. Interpretation. The central half of patients cost between about GBP 1,100 and GBP 3,800 a year, a spread of GBP 2,700 by the halves method and QUARTILE.EXC, though the figure falls to GBP 1,900 with QUARTILE.INC. One patient sits beyond the upper fence and should be checked, not removed. A mean rebuilt from the quartiles understates this right-skewed cost by about a fifth, an error a model or budget impact analysis would carry forward.
Misreadings and limits
Most errors with the IQR arise when it is asked about the mean or about uncertainty. The quartiles describe the middle of the patient distribution well, and trouble starts when that description feeds a calculation needing something else.
- Reading the IQR as an uncertainty interval. It describes how patients differ, not how precisely the median or mean is known.
- Comparing IQRs across definitions. Small samples give materially different quartiles in different software.
- Treating median (IQR) as a model input. Budgets, incremental costs and QALY totals scale with the mean, and the IQR cannot be used as a standard error.
- Dropping patients beyond the fences. High-cost patients are often real, and removing them biases the mean downwards.
- Assuming the quartiles reveal the tails. Two cost distributions with the same quartiles can have very different upper tails and means, so skewness and the mean belong alongside.
- Converting without stating the assumption. Formulas that rebuild means from quartiles assume near-normal data, so for skewed costs a sensitivity analysis, or bootstrapping where patient-level data exist, is more defensible.
Sources
- Hyndman RJ, Fan Y. Sample quantiles in statistical packages. The American Statistician. 1996;50(4):361-365. https://doi.org/10.1080/00031305.1996.10473566
- Higgins JPT, Li T, Deeks JJ (editors). Chapter 6: Choosing effect measures and computing estimates of effect (last updated August 2023). In: Higgins JPT, Thomas J, Chandler J, et al. (editors). Cochrane Handbook for Systematic Reviews of Interventions version 6.5. Cochrane; 2024. Sections 6.5.2.5 and 6.5.2.9. https://www.cochrane.org/authors/handbooks-and-manuals/handbook/current/chapter-06
- Deeks JJ, Higgins JPT, Altman DG, McKenzie JE, Veroniki AA (editors). Chapter 10: Analysing data and undertaking meta-analyses (last updated November 2024). In: Cochrane Handbook for Systematic Reviews of Interventions version 6.5. Cochrane; 2024. Section 10.5.3. https://www.cochrane.org/authors/handbooks-and-manuals/handbook/current/chapter-10
- Microsoft. QUARTILE.INC function and QUARTILE.EXC function. Microsoft Support. https://support.microsoft.com/en-us/office/quartile-inc-function-1bbacc80-5075-42f1-aed6-47d735c4819d and https://support.microsoft.com/en-us/office/quartile-exc-function-5a355b7a-840b-4a01-b0f1-f538c2864cad (accessed 25 October 2026)
- Moher D, Hopewell S, Schulz KF, et al. CONSORT 2010 explanation and elaboration: updated guidelines for reporting parallel group randomised trials. BMJ. 2010;340:c869. https://doi.org/10.1136/bmj.c869
- NIST/SEMATECH. e-Handbook of Statistical Methods, sections 1.3.5.6 (Measures of scale) and 7.1.6 (What are outliers in the data?). National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm and https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (accessed 25 October 2026)
- R Core Team. quantile {stats}: Sample quantiles. R documentation, stats package version 4.6.0. https://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html (accessed 25 October 2026)
- Thompson SG, Barber JA. How should cost data in pragmatic randomised trials be analysed? BMJ. 2000;320(7243):1197-1200. https://doi.org/10.1136/bmj.320.7243.1197
- Wan X, Wang W, Liu J, Tong T. Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology. 2014;14:135. https://doi.org/10.1186/1471-2288-14-135
Related Concepts (5)
Library
Publications
1
Statistical Analysis of Cost-Effectiveness Data — Willan & Briggs, 1st Edition ed., 2006 (John Wiley & Sons)
A synthesis of statistical methods for analysing cost-effectiveness data, including net-benefit regression, confidence intervals for the ICER, cost-effectiveness acceptability curves, and covariate adjustment. Part of the Wiley Statistics in Practice series.
BookView source →
Frequently Asked Questions (6)
What is the interquartile range?
The interquartile range (IQR) is the gap between the 25th and 75th percentiles, the spread of the middle half of data such as skewed patient costs.
Source: Higgins et al. 2024
What span of the data does the interquartile range describe?
The interquartile range covers the central half of a set of ordered values, from the lower quartile at the 25th percentile to the upper quartile at the 75th percentile. The Cochrane Handbook describes interquartile ranges as showing where the central 50% of participants' outcomes lie. About a quarter of the values fall below the lower quartile and about a quarter above the upper quartile, so both tails are left out. The measure is in the units of the data, GBP for costs or days for a hospital stay. Because the tails are excluded, the interquartile range says nothing about the mean on which budgets and cost-effectiveness ratios rest.
Source: Higgins et al. 2024
How is the interquartile range calculated?
The interquartile range is the upper quartile minus the lower quartile of the sorted values, IQR = Q3 minus Q1. Locating the quartiles is less simple, because sample quartiles are not unique. Hyndman and Fan reviewed the sample quantile definitions used in statistical packages and found that one package may use different definitions for different tasks, and a position falling between two sorted values is resolved by linear interpolation. For nine illustrative annual patient costs from GBP 800 to GBP 9,000, the medians of the lower and upper halves give an interquartile range of GBP 2,700, while the type 7 rule behind QUARTILE.INC gives GBP 1,900. Methods sections should name the definition used.
Source: Hyndman and Fan 1996
Why is the interquartile range robust to outliers?
Because it ignores the lowest and highest quarters of the ordered data, an extreme value in either tail does not change the interquartile range. The NIST/SEMATECH e-Handbook contrasts the range, which uses only the two most extreme points, with the interquartile range, which uses only the middle portion of the data, and notes that with extreme values in the tails the interquartile range can give a more stable estimate of spread than the standard deviation. The price is efficiency, since its intervals tend to be wider than the best achievable when the true shape of the distribution is known. Two cost distributions with the same quartiles can still have very different upper tails and means.
Source: NIST/SEMATECH 2012
When is the interquartile range used?
The interquartile range is used mainly to describe skewed continuous data, reported as median (IQR) for costs, resource use, length of stay and utility values in trial and cohort reports. Thompson and Barber reproduce a hospital at home trial in which three-month general practitioner costs were given as median (IQR) GBP 42.84 (0 to 64.61) for patients treated at home and GBP 15.49 (0 to 45.19) for inpatients. They argue that the total budget equals the arithmetic mean cost times the number of patients, so economic evaluation needs the mean. The interquartile range therefore describes a typical patient and the spread around that patient, but it cannot replace the mean or a standard error as a model input.
Source: Thompson and Barber 2000
How does the interquartile range relate to the median and quartiles?
The interquartile range is the distance between the lower and upper quartiles, and the median sits between them at the 50th percentile. The interquartile range pairs with the median in the way the standard deviation pairs with the mean. Wan and colleagues used these quartile summaries to rebuild missing statistics for meta-analysis, estimating the mean as the sum of the lower quartile, median and upper quartile divided by three, and the standard deviation as the interquartile range divided by a sample-size divisor that tends to 1.349. These estimators assume near-normal data, and Wan and colleagues leave open how far they make sense for very asymmetric data such as patient costs.
Source: Wan et al. 2014
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 26 Oct 2026
Content version: 1.0.1
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/interquartile-range
- Term code
- HE-ES-SA-086
- Wikidata
- Q1916617
Stable URI · Machine-readable · Resolvable · CC BY 4.0
