View source: R/medcouple_weight.R
medcouple_weight | R Documentation |
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.
medcouple_weight(x, drop.na = FALSE)
x |
A numeric vector. |
drop.na |
Logical value indicating whether to remove missing values (NA) or not. |
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.
A tibble with two numeric columns:
LMC
: Left medcouple.
RMC
: Right medcouple.
Christian L. Goueguel
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
vec <- c(-100, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100)
# non-robust approach
moments::kurtosis(vec)
# robust approach
medcouple_weight(vec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.