Skip to contents

The rule is deliberately not a test: no null, no p-value, no distributional assumption, only a pair of fences drawn from the middle half of the data. The hinges are used rather than sample quantiles, because the hinges are what Tukey defined and what a boxplot draws.

Usage

IqrA(x, k = 1.5)

Arguments

x

Sample.

k

Fence multiplier; 1.5 for outliers, 3 for far-out points.

Value

List with estimate, n_out, lower, upper, iqr, flags, n.

Details

Formula: flag x < H_L - k (H_U - H_L) or x > H_U + k (H_U - H_L).

References

Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley, chapters 2 and 3.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
IqrA(V)
#> $estimate
#> [1] 0
#> 
#> $n_out
#> [1] 0
#> 
#> $lower
#> [1] -3.5
#> 
#> $upper
#> [1] 12.5
#> 
#> $iqr
#> [1] 4
#> 
#> $flags
#> [1] 0 0 0 0 0 0 0 0
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Tukey fences on the hinges"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"