| ineq.weighted | R Documentation | 
Calculates weighted mean and sum of X (or median of X), and a set of relevant inequality measures.
ineq.weighted(
  X,
  W = rep(1, length(X)),
  AF.norm = TRUE,
  Atkinson.e = 1,
  Jenkins.alfa = 0.8,
  Entropy.e = 0.5,
  Kolm.p = 1,
  Kolm.scale = "Standardization",
  Leti.norm = T,
  AN_Y.a = 1,
  AN_Y.b = 1,
  Apouey.a = 2/(1 - length(W[!is.na(W) & !is.na(X)])),
  Apouey.b = length(W[!is.na(W) & !is.na(X)])/(length(W[!is.na(W) & !is.na(X)]) - 1),
  BL.withsqrt = FALSE
)
| X | is a data vector | 
| W | is a vector of weights | 
| AF.norm | (logical). If TRUE (default) then index is divided by its maximum possible value | 
| Atkinson.e | is a parameter for Atkinson coefficient | 
| Jenkins.alfa | is a parameter for Jenkins coefficient | 
| Entropy.e | is a generalized entropy index parameter | 
| Kolm.p | is a parameter for Kolm index | 
| Kolm.scale | method of data standardization before computing | 
| Leti.norm | (logical). If TRUE (default) then Leti index is divided by a maximum possible value | 
| AN_Y.a | is a positive parameter for Abul Naga and Yalcin inequality measure | 
| AN_Y.b | is a parameter for Abul Naga and Yalcin inequality measure | 
| Apouey.a | is a parameter for Apouey inequality measure | 
| Apouey.b | is a parameter for Apouey inequality measure | 
| BL.withsqrt | if TRUE function returns index given by BL2, elsewhere by BL (default). See more in details of BL function. | 
Function checks if X is a numeric or an ordered factor. Then it calculates all appropriate inequality measures.
The data frame with weighted mean and sum of X, and all inequality measures relevant for a numeric data. In a case of an ordered factor, the data frame with median of X, and all relevant inequality measures.
# Compare weighted and unweighted result.
X=1:10
W=1:10
ineq.weighted(X)
ineq.weighted(X,W)
data(Tourism)
# Results for Total expenditure with sample weights:
X=Tourism$`Total expenditure`
W=Tourism$`Sample weight`
ineq.weighted(X)
ineq.weighted(X,W)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.