Statistics Toolbox    
iqr

Interquartile range (IQR) of a sample

Syntax

Description

y = iqr(X) computes the difference between the 75th and the 25th percentiles of the sample in X. The IQR is a robust estimate of the spread of the data, since changes in the upper and lower 25% of the data do not affect it.

If there are outliers in the data, then the IQR is more representative than the standard deviation as an estimate of the spread of the body of the data. The IQR is less efficient than the standard deviation as an estimate of the spread when the data is all from the normal distribution.

Multiply the IQR by 0.7413 to estimate (the second parameter of the normal distribution.)

Examples

This Monte Carlo simulation shows the relative efficiency of the IQR to the sample standard deviation for normal data.

See Also
std, mad, range


  inconsistent iwishrnd