interquartile_range

Function interquartile_range 

Source
pub fn interquartile_range<T>(data: &[T]) -> Option<T>
where T: Num + NumCast + Copy + PartialOrd,
Expand description

Computes the interquartile range (IQR) of a numeric data series.

The IQR is the difference between the 75th percentile and the 25th percentile of a data series, and a measure for the natural spread.

ยงExample

use quant_mathema::stats::interquartile_range;

let data = [10, 20, 30, 40, 50];
if let Some(iqr) = interquartile_range(&data) {
    assert_eq!(iqr, 20);
}