IQrange | R Documentation |
Computes (standardized) interquartile range of the x
values.
IQrange(x, na.rm = FALSE, type = 7) sIQR(x, na.rm = FALSE, type = 7, constant = 2*qnorm(0.75))
x |
a numeric vector. |
na.rm |
logical. Should missing values be removed? |
type |
an integer between 1 and 9 selecting one of nine quantile
algorithms; for more details see |
constant |
standardizing contant; see details below. |
This function IQrange
computes quartiles as
IQR(x) = quantile(x,3/4) - quantile(x,1/4)
.
The function is identical to function IQR
. It was added
before the type
argument was introduced to function IQR
in 2010 (r53643, r53644).
For normally N(m,1) distributed X, the expected value of
IQR(X)
is 2*qnorm(3/4) = 1.3490
, i.e., for a normal-consistent
estimate of the standard deviation, use IQR(x) / 1.349
. This is implemented
in function sIQR
(standardized IQR).
Matthias Kohl Matthias.Kohl@stamats.de
Tukey, J. W. (1977). Exploratory Data Analysis. Reading: Addison-Wesley.
quantile
, IQR
.
IQrange(rivers) ## identical to IQR(rivers) ## other quantile algorithms IQrange(rivers, type = 4) IQrange(rivers, type = 5) ## standardized IQR sIQR(rivers) ## right-skewed data distribution sd(rivers) mad(rivers) ## for normal data x <- rnorm(100) sd(x) sIQR(x) mad(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.