Robust Range using Boxplot 'Quartiles'
rrange.RdCompute a robust range, i.e. the usual range() as long
as there are no outliers, using the “whisker boundaries” of
boxplot, i.e., boxplot.stats.
Arguments
- x
numeric vector the robust range of which shall be computed.
- range
number for S compatibility;
1.5 * rangeis equivalent tocoef.- coef
numeric multiplication factor definying the outlier boundary, see ‘Details’ below.
- na.rm
logical indicating how
NAvalues should be handled; they are simply dropped whenna.rm = TRUEas by default.
Details
The robust range is really just what boxplot.stats(x,
coef=coef) returns as the whisker boundaries.
This is the most extreme values x[j] still inside median
plus/minus coef * IQR.
Value
numeric vector c(m,M) with \(m \le M\) which is (not
strictly) inside range(x) = c(min(x),max(x)).
See also
range, fivenum,
boxplot and boxplot.stats.
A more sophisticated robust range for (strongly) asymmetric data can
be derived from the skewness adjusted boxplot statistics
adjboxStats which is a generalization of
boxplot.stats.