Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Interquartile range
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Measure of statistical dispersion}} {{Redirect|IQR}} [[Image:Boxplot vs PDF.svg|250px|thumb|[[Boxplot]] (with an interquartile range) and a [[probability density function]] (pdf) of a Normal {{maths|N(0,Ο<sup>2</sup>)}} Population]] In [[descriptive statistics]], the '''interquartile range''' ('''IQR''') is a measure of [[statistical dispersion]], which is the spread of the data.<ref name=":1">{{Cite book|last=Dekking|first=Frederik Michel|url=http://link.springer.com/10.1007/1-84628-168-7|title=A Modern Introduction to Probability and Statistics|last2=Kraaikamp|first2=Cornelis|last3=LopuhaΓ€|first3=Hen Paul|last4=Meester|first4=Ludolf Erwin|date=2005|publisher=Springer London|isbn=978-1-85233-896-1|series=Springer Texts in Statistics|location=London|doi=10.1007/1-84628-168-7}}</ref> The IQR may also be called the '''midspread''', '''middle 50%''', '''fourth spread''', or '''Hβspread.''' It is defined as the difference between the 75th and 25th [[percentiles]] of the data.<ref name="Upton" /><ref name="ZK" /><ref>{{Cite book|last=Ross|first=Sheldon|title=Introductory Statistics|publisher=Elsevier|year=2010|isbn=978-0-12-374388-6|location=Burlington, MA|pages=103β104}}</ref> To calculate the IQR, the data set is divided into [[quartile]]s, or four rank-ordered even parts via linear interpolation.<ref name=":1" /> These quartiles are denoted by ''Q''<sub>1</sub> (also called the lower quartile), ''Q''<sub>2</sub> (the [[median]]), and ''Q''<sub>3</sub> (also called the upper quartile). The lower quartile corresponds with the 25th percentile and the upper quartile corresponds with the 75th percentile, so IQR = ''Q''<sub>3</sub> β Β ''Q''<sub>1</sub><ref name=":1" /><sub>.</sub> The IQR is an example of a [[trimmed estimator]], defined as the 25% trimmed [[Range (statistics)|range]], which enhances the accuracy of dataset statistics by dropping lower contribution, outlying points.<ref name=":2">{{Cite book|last=Kaltenbach|first=Hans-Michael|url=https://www.worldcat.org/oclc/763157853|title=A concise guide to statistics|date=2012|publisher=Springer|isbn=978-3-642-23502-3|location=Heidelberg|oclc=763157853}}</ref> It is also used as a [[Robust measures of scale|robust measure of scale]]<ref name=":2" /> It can be clearly visualized by the box on a [[box plot]].<ref name=":1" /> ==Use== Unlike total [[range (statistics)|range]], the interquartile range has a [[breakdown point]] of 25%<ref>{{cite news |title=Explicit Scale Estimators with High Breakdown Point |first1=Peter J. |last1=Rousseeuw |first2=Christophe |last2=Croux |work=L1-Statistical Analysis and Related Methods |editor=Y. Dodge |location=Amsterdam |publisher=North-Holland |year=1992 |pages=77β92 |url=https://feb.kuleuven.be/public/u0017833/PDF-FILES/l11992.pdf}}</ref> and is thus often preferred to the total range. The IQR is used to build [[box plot]]s, simple graphical representations of a [[probability distribution]]. The IQR is used in businesses as a marker for their [[income]] rates. For a symmetric distribution (where the median equals the [[midhinge]], the average of the first and third quartiles), half the IQR equals the [[median absolute deviation]] (MAD). The [[median]] is the corresponding measure of [[central tendency]]. The IQR can be used to identify [[outlier]]s (see [[#Outliers|below]]). The IQR also may indicate the [[skewness]] of the dataset.<ref name=":1"/> {{Anchor|Quartile deviation}} The quartile deviation or semi-interquartile range is defined as half the IQR.<ref name="Yule">{{cite book |first=G. Udny |last=Yule |title=An Introduction to the Theory of Statistics |url=https://archive.org/details/in.ernet.dli.2015.223539 |publisher=Charles Griffin and Company |date=1911 |pages=[https://archive.org/details/in.ernet.dli.2015.223539/page/n170 147]β148}}</ref> ==Algorithm== The IQR of a set of values is calculated as the difference between the upper and lower quartiles, Q<sub>3</sub> and Q<sub>1</sub>. Each quartile is a median<ref name=":0">{{Cite book|title=Beta [beta] mathematics handbook : concepts, theorems, methods, algorithms, formulas, graphs, tables|last=Bertil.|first=Westergren|date=1988|publisher=[[Studentlitteratur]]|isbn=9144250517|oclc=18454776|page=348}}</ref> calculated as follows. Given an even ''2n'' or odd ''2n+1'' number of values :''first quartile Q<sub>1</sub>'' = median of the ''n'' smallest values :''third quartile Q<sub>3</sub>'' = median of the ''n'' largest values<ref name=":0" /> The ''second quartile Q<sub>2</sub>'' is the same as the ordinary median.<ref name=":0" /> ==Examples== ===Data set in a table=== The following table has 13 rows, and follows the rules for the odd number of entries. {| class="wikitable" style="text-align:center;" |- ! width="40px" | i ! width="40px" |x[i] ! Median ! Quartile |- | 1 | 7 | rowspan="14" |Q<sub>2</sub>=87<br /> (median of whole table) | rowspan="6" |Q<sub>1</sub>=31<br /> (median of lower half, from row 1 to 6) |- | 2 | 7 |- | 3 | 31 |- | 4 | 31 |- | 5 | 47 |- | 6 | 75 |- | 7 | 87 | |- | 8 | 115 | rowspan="6" | Q<sub>3</sub>=119<br /> (median of upper half, from row 8 to 13) |- | 9 | 116 |- | 10 | 119 |- | 11 |119 |- | 12 | 155 |- | 13 | 177 |} For the data in this table the interquartile range is IQR = Q<sub>3</sub> − Q<sub>1</sub> = 119 - 31 = 88. ===Data set in a plain-text box plot=== <pre style="font-family:monospace"> +βββββ+β+ * |βββββββββββ| | |βββββββββββ| +βββββ+β+ +βββ+βββ+βββ+βββ+βββ+βββ+βββ+βββ+βββ+βββ+βββ+βββ+ Number line 0 1 2 3 4 5 6 7 8 9 10 11 12 </pre> For the data set in this [[box plot]]: * Lower (first) quartile ''Q''<sub>1</sub> = 7 * Median (second quartile) ''Q''<sub>2</sub> = 8.5 * Upper (third) quartile ''Q''<sub>3</sub> = 9 * Interquartile range, IQR = ''Q''<sub>3</sub> - ''Q''<sub>1</sub> = 2 * Lower 1.5*IQR whisker = ''Q''<sub>1</sub> - 1.5 * IQR = 7 - 3 = 4. (If there is no data point at 4, then the lowest point greater than 4.) * Upper 1.5*IQR whisker = ''Q''<sub>3</sub> + 1.5 * IQR = 9 + 3 = 12. (If there is no data point at 12, then the highest point less than 12.) * Pattern of latter two bullet points: If there are no data points at the true quartiles, use data points slightly "inland" (closer to the median) from the actual quartiles. This means the 1.5*IQR whiskers can be uneven in lengths. The median, minimum, maximum, and the first and third quartile constitute the [[Five-number summary]].<ref>Dekking, Kraaikamp, LopuhaΓ€ & Meester, pp. 235β237</ref> ==Distributions== The interquartile range of a continuous distribution can be calculated by integrating the [[probability density function]] (which yields the [[cumulative distribution function]]βany other means of calculating the CDF will also work). The lower quartile, ''Q''<sub>1</sub>, is a number such that integral of the PDF from -β to ''Q''<sub>1</sub> equals 0.25, while the upper quartile, ''Q''<sub>3</sub>, is such a number that the integral from -β to ''Q''<sub>3</sub> equals 0.75; in terms of the CDF, the quartiles can be defined as follows: :<math>Q_1 = \text{CDF}^{-1}(0.25) ,</math> :<math>Q_3 = \text{CDF}^{-1}(0.75) ,</math> where CDF<sup>β1</sup> is the [[quantile function]]. The interquartile range and median of some common distributions are shown below {| class="wikitable" |- ! Distribution ! Median ! IQR |- | [[Normal distribution|Normal]] | ΞΌ | 2 Ξ¦<sup>−1</sup>(0.75)Ο β 1.349Ο β (27/20)Ο |- | [[Laplace distribution|Laplace]] | ΞΌ | 2''b'' ln(2) β 1.386''b'' |- | [[Cauchy distribution|Cauchy]] | ΞΌ |2Ξ³ |} ===Interquartile range test for normality of distribution=== The IQR, [[mean]], and [[standard deviation]] of a population ''P'' can be used in a simple test of whether or not ''P'' is [[Normal distribution|normally distributed]], or Gaussian. If ''P'' is normally distributed, then the [[standard score]] of the first quartile, ''z''<sub>1</sub>, is β0.67, and the standard score of the third quartile, ''z''<sub>3</sub>, is +0.67. Given ''mean'' = <math>\bar{P}</math> and ''standard deviation'' = Ο for ''P'', if ''P'' is normally distributed, the first quartile :<math>Q_1 = (\sigma \, z_1) + \bar{P}</math> and the third quartile :<math>Q_3 = (\sigma \, z_3) + \bar{P}</math> If the actual values of the first or third quartiles differ substantially{{Clarify|date=December 2012}} from the calculated values, ''P'' is not normally distributed. However, a normal distribution can be trivially perturbed to maintain its Q1 and Q2 std. scores at 0.67 and β0.67 and not be normally distributed (so the above test would produce a false positive). A better test of normality, such as [[QβQ plot]] would be indicated here. ==Outliers== [[File:Box-Plot mit Interquartilsabstand.png|thumb|[[Box-and-whisker plot]] with four mild outliers and one extreme outlier. In this chart, outliers are defined as mild above Q3 + 1.5 IQR and extreme above Q3 + 3 IQR.]] The interquartile range is often used to find [[outlier]]s in data. Outliers here are defined as observations that fall below Q1 β 1.5 IQR or above Q3 + 1.5 IQR. In a boxplot, the highest and lowest occurring value within this limit are indicated by ''whiskers'' of the box (frequently with an additional bar at the end of the whisker) and any outliers as individual points. ==See also== * {{Annotated link|Interdecile range}} * {{Annotated link|Midhinge}} * {{Annotated link|Probable error}} * {{Annotated link|Robust measures of scale}} ==References== {{reflist|refs= <ref name=Upton>{{cite book |title=Understanding Statistics |first1=Graham|last1=Upton|first2=Ian|last2= Cook|year=1996 |publisher=Oxford University Press |isbn=0-19-914391-9 |page=55 |url=https://books.google.com/books?id=vXzWG09_SzAC&q=interquartile+range&pg=PA55}}</ref> <ref name= ZK>Zwillinger, D., Kokoska, S. (2000) ''CRC Standard Probability and Statistics Tables and Formulae'', CRC Press. {{ISBN|1-58488-059-7}} page 18.</ref> }} ==External links== *{{Commonscatinline}} {{Statistics|descriptive}} {{DEFAULTSORT:Interquartile Range}} [[Category:Scale statistics]] [[Category:Wikipedia articles with ASCII art]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Annotated link
(
edit
)
Template:Cite book
(
edit
)
Template:Cite news
(
edit
)
Template:Clarify
(
edit
)
Template:Commonscatinline
(
edit
)
Template:Maths
(
edit
)
Template:Redirect
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Statistics
(
edit
)