Skip to contents

This function calculates the left medcouple (LMC) and the right medcouple (RMC) for a given numeric vector. The left and right medcouples provide a robust measure of the distribution's tail behavior in the presence of outliers or contaminated data.

Usage

medcouple_weight(x, drop.na = FALSE)

Arguments

x

A numeric vector.

drop.na

Logical value indicating whether to remove missing values (NA) or not.

Value

A tibble with two numeric columns:

  • LMC: Left medcouple.

  • RMC: Right medcouple.

Details

The left and right medcouples are a robust measure of tail weight based on the median and the medcouple (Brys et al. 2004), which is a kernel estimator of the cumulative distribution function (CDF). The left and right medcouples are robust to outliers and have a breakdown value of 25%. Specifically, the left medcouple (LMC) measures the skewness in the lower tail of the distribution, while the right medcouple (RMC) measures the skewness in the upper tail.

The interpretation of LMC and RMC is as follows:

  • Values close to 0 indicate a symmetric distribution or light tails.

  • Positive values indicate right-skewness or a heavier right tail.

  • Negative values indicate left-skewness or a heavier left tail.

References

  • Brys, G., Hubert, M., and Struyf, A. (2006). Robust measures of tail weight. Computational Statistics & Data Analysis, 50(3):733-759

  • Brys, G., Hubert, M., and Struyf, A. (2004). A robust measure of skewness. Journal of Computational and Graphical Statistics, 13(4):996-1017

Author

Christian L. Goueguel

Examples

vec <- c(-100, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100)
# non-robust approach
moments::kurtosis(vec)
#> [1] 6.474793

# robust approach
medcouple_weight(vec)
#> # A tibble: 1 × 2
#>     LMC   RMC
#>   <dbl> <dbl>
#> 1     0     0