Statistical Methods
Specify the Quantile Method Behind Your Quartiles
Treat the calculation method as part of the result
A sample quartile is not always a uniquely determined observation. Several accepted methods choose or interpolate between ordered values differently. This is especially visible in small samples, where two programs can return different first quartiles without either having imported the data incorrectly.
The official R quantile documentation describes nine methods and identifies type 7 as the default. Record the method you actually use rather than assuming every spreadsheet or statistical package shares the same convention.
Define the eligible observations
Before sorting, establish the analysis population, measurement time, units, and missing-value handling. Check whether repeated records represent distinct eligible observations or accidental duplicates. A reproducible interpolation rule cannot rescue an incorrect denominator or a mixture of incompatible measurements.
Keep the number observed and the number missing beside the quartiles. If the dataset contains special codes for not applicable or unknown, resolve those codes before numerical summaries. Do not allow a code such as 999 to enter the ordered list as an extreme measured value.
Recalculate a fictional example
Take the ordered fictional values 1, 2, 3, 4, and 9. For type 7 interpolation, the position is 1 + (n − 1)p. At p = 0.25 the position is 2, so Q1 is 2. At p = 0.75 it is 4, so Q3 is 4. The median is 3 and the interquartile range is 2.
For an example with interpolation, values 1, 2, 4, and 8 give a type 7 first-quartile position of 1.75 and Q1 of 1.75. The third-quartile position is 3.25, giving Q3 of 5. These examples are invented to make the convention visible.
Check software differences deliberately
Use the rank-summary tool to inspect its explicitly stated method, and retain the input list when practicing with synthetic data. The descriptive-summary worksheet provides space for the method, population, units, and display precision.
If a result differs from another program, compare the cleaned observations, quantile definition, weights, and rounding before assuming a bug. Weighted quantiles require their own specification; the unweighted interpolation example does not implement a survey analysis. Likewise, a quantile of category codes may be awkward to interpret for a single ordinal item.
Round only after calculating the summary and keep enough internal precision to reproduce it. When the data are sparse or highly discrete, show a distribution or category counts alongside the summary. Finish by recording the software version, function options, and convention in the analysis notes so a later update cannot silently change the reported quartiles.
Source checked on 2 November 2026; fictional quantiles independently recalculated.