Skip to contents

For each dimension: lower = -iqr_factor * IQR, upper = +iqr_factor * IQR. Equivalent to rENA's:


  oi <- c(IQR(pts[,1]), ...) * iqr_factor
  matrix(rep(oi, 2), ncol = n_dims, byrow = TRUE) * c(-1, 1)

IQR uses R's default type = 7 quantile.

Usage

outlier_ci(points, iqr_factor = 1.5)

Arguments

points

Numeric matrix (units x dims), one row per unit in the group

iqr_factor

Multiplier applied to the IQR (default 1.5, the Tukey fence)

Value

Numeric matrix (n_dims x 2): columns are [lower, upper].

Examples

pts <- matrix(c(1, 2, 3, 4, 10, 12, 11, 13), ncol = 2)
outlier_ci(pts)  # rows = dimensions; columns = -1.5 * IQR, +1.5 * IQR
#>       [,1] [,2]
#> [1,] -2.25 2.25
#> [2,] -2.25 2.25