For weighted mean and weighted total of X (or median of X) as well as for each relevant inequality measure, returns outputs from ineq.weighted and bootstrap outcomes: expected value, bias (in %), standard deviation, coefficient of variation, lower and upper bound of confidence interval.
ineq.weighted.boot(
X,
W = rep(1, length(X)),
B = 100,
AF.norm = TRUE,
Atkinson.e = 1,
Jenkins.alfa = 0.8,
Entropy.power = 0.5,
zeroes = "include",
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,
keepSamples = FALSE,
keepMeasures = FALSE,
conf.alpha = 0.05,
calib.boot = FALSE,
Xs = rep(1, length(X)),
total = sum(W),
calib.method = "truncated",
bounds = c(low = 0, upp = 10)
)
This functions returns a data frame from ineq.weighted extended with bootstrap results: expected value, bias (in %), standard deviation, coefficient of variation, lower and upper bound of confidence interval. If keepSamples=TRUE or keepMeasures==TRUE then the output becomes a list. If keepSamples=TRUE, the functions returns Xb and Wb, which are the samples of vector data and the samples of weights, respectively. If keepMeasures==TRUE, the functions returns Mb, which is a set of inequality measures from bootstrapping.
is a data vector
is a vector of weights
is a number of bootstrap samples.
(logical). If TRUE (default) then index is divided by its maximum possible value
is a parameter for Atkinson coefficient
is a parameter for Jenkins coefficient
is a generalized entropy index parameter
defines what to do with zeroes in the data vector. Possible options are "remove" and "include". See Entropy function for details.
is a parameter for Kolm index
method of data standardization before computing
(logical). If TRUE (default) then Leti index is divided by a maximum possible value
is a positive parameter for Abul Naga and Yalcin inequality measure
is a parameter for Abul Naga and Yalcin inequality measure
is a parameter for Apouey inequality measure
is a parameter for Apouey inequality measure
if TRUE function returns index given by BL2, elsewhere by BL (default). See more in details of BL function.
if TRUE, it returns bootstrap samples of data (Xb) and weights (Wb)
if TRUE, it returns values of all inequality measures for each bootstrap sample
significance level for confidence interval
if FALSE, then naive bootstrap is performed, calibrated bootstrap elsewhere
matrix of calibration variables. By default it is a vector of 1's, applied if calib.boot is TRUE
vector of population totals. By default it is a sum of weights, applied if calib.boot is TRUE
weights' calibration method for function calib (sampling)
vector of bounds for the g-weights used in the truncated and logit methods; 'low' is the smallest value and 'upp' is the largest value
By default, naive bootstrap is performed, that is no weights calibration is conducted. You can choose calibrated bootstrap to calibrate weights with respect to provided variables (Xs) and totals (total). Confidence interval is simply derived with quantile of order \(\alpha\) and \(1-\alpha\) where \(\alpha\) is a significance level for confidence interval.
# Inequality measures with additional statistics for numeric variable
X=1:10
W=1:10
ineq.weighted.boot(X,W,B=10)
# Inequality measures with additional statistics for ordered factor variable
X=factor(c('H','H','M','M','L','L'),levels = c('L','M','H'),ordered = TRUE)
W=c(2,2,3,3,8,8)
ineq.weighted.boot(X,W,B=10)
Run the code above in your browser using DataLab