Wednesday, April 22, 2020

IQR

A measure of spread. Inter-quartile range, or midspread. This covers the middle 50% of a distribution - the area between the 25th  and 75th percentiles, which it calculates using the quantile function. You can opt to remove NA values.

R Example

Get the IQR of the rivers dataset (part of the datasets package).
> IQR(rivers)
[1] 370

In the rivers dataset, the 75% value minus the 25% value is 370. You prove this using fivenum:
> fivenum(rivers)
[1]  135  310  425  680 3710

680 - 310 == 370.

No comments:

Post a Comment

Please help to combat malicious use of the Internet.