hb: Hiridoglu-Berthelot function

View source: R/genericrules.R

hbR Documentation

Hiridoglu-Berthelot function

Description

A function to measure ‘outlierness’ for skew distributed data with long right tails. The method works by measuring deviation from a reference value, by default the median. Deviation from above is measured as the ratio between observed and refence values. Deviation from below is measured as the inverse: the ratio between reference value and observed values.

Usage

hb(x, ref = stats::median, ...)

Arguments

x

[numeric]

ref

[function] or [numeric]

...

arguments passed to ref after x

Value

\max\{x/ref(x), ref(x)/x\}-1 if ref is a function, otherwise \max\{x/ref, ref/x\}-1

References

Hidiroglou, M. A., & Berthelot, J. M. (1986). Statistical editing and imputation for periodic business surveys. Survey methodology, 12(1), 73-83.

See Also

Other cross-record-helpers: contains_exactly(), do_by(), exists_any(), hierarchy(), is_complete(), is_linear_sequence(), is_unique()

Examples

x <- seq(1,20,by=0.1)
plot(x,hb(x), 'l')


validate documentation built on July 4, 2024, 9:07 a.m.