Computes Blair and Lacy inequality measure of a given variable taking into account weights.
Usage
BL(X, W = rep(1, length(X)), withsqrt = FALSE)
Value
The value of Blair and Lacy coefficient.
Arguments
X
is a data vector (numeric or ordered factor)
W
is a vector of weights
withsqrt
if TRUE function returns index given by BL2, elsewhere by BL (default). See more in details.
Details
Let \(m\) be the median category, \(n\) be the number of categories and \(P_i\) be the cumulative distribution of \(i\)-th category.
The indices of Blair and Lacy (2000) are the following:
$$BL = 1-\frac{\sum_{i=1}^{n-1}(P_{i}-0.5)^2}{\frac{n-1}{4}}$$
$$BL2 = 1-\left(\frac{\sum_{i=1}^{n-1}(P_{i}-0.5)^2}{\frac{n-1}{4}}\right)^{\frac{1}{2}}$$
References
Blair J, Lacy M G. (2000): Statistics of ordinal variation, Sociological Methods and Research 28(251);251-280.
# Compare weighted and unweighted resultX=1:10W=1:10BL(X)
BL(X,W)
data(Well_being)
# Blair and Lacy index for health assessment with sample weightsX=Well_being$V1
W=Well_being$Weight
BL(X,W)