BL | R Documentation |
Computes Blair and Lacy inequality measure of a given variable taking into account weights.
BL(X, W = rep(1, length(X)), withsqrt = FALSE)
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. |
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}}
The value of Blair and Lacy coefficient.
Blair J, Lacy M G. (2000): Statistics of ordinal variation, Sociological Methods and Research 28(251);251-280.
# Compare weighted and unweighted result
X=1:10
W=1:10
BL(X)
BL(X,W)
data(Well_being)
# Blair and Lacy index for health assessment with sample weights
X=Well_being$V1
W=Well_being$Weight
BL(X,W)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.