Compute variance and confidence interval estimates of indicators on social exclusion and poverty based on bootstrap resampling.
bootVar(
inc,
weights = NULL,
years = NULL,
breakdown = NULL,
design = NULL,
cluster = NULL,
data = NULL,
indicator,
R = 100,
bootType = c("calibrate", "naive"),
X,
totals = NULL,
ciType = c("perc", "norm", "basic"),
alpha = 0.05,
seed = NULL,
na.rm = FALSE,
gender = NULL,
method = NULL,
...
)
An object of the same class as indicator
is returned. See
arpr
, qsr
, rmpg
or
gini
for details on the components.
either a numeric vector giving the equivalized disposable income,
or (if data
is not NULL
) a character string, an integer or a
logical vector specifying the corresponding column of data
.
optional; either a numeric vector giving the personal sample
weights, or (if data
is not NULL
) a character string, an
integer or a logical vector specifying the corresponding column of
data
.
optional; either a numeric vector giving the different years of
the survey, or (if data
is not NULL
) a character string, an
integer or a logical vector specifying the corresponding column of
data
. If supplied, values are computed for each year.
optional; either a numeric vector giving different domains,
or (if data
is not NULL
) a character string, an integer or a
logical vector specifying the corresponding column of data
. If
supplied, the values for each domain are computed in addition to the overall
value.
optional; either an integer vector or factor giving different
strata for stratified sampling designs, or (if data
is not
NULL
) a character string, an integer or a logical vector specifying
the corresponding column of data
. If supplied, this is used as
strata
argument in the call to boot
.
optional; either an integer vector or factor giving different
clusters for cluster sampling designs, or (if data
is not
NULL
) a character string, an integer or a logical vector specifying
the corresponding column of data
.
an optional data.frame
.
an object inheriting from the class "indicator"
that
contains the point estimates of the indicator (see arpr
,
qsr
, rmpg
or gini
).
a numeric value giving the number of bootstrap replicates.
a character string specifying the type of bootstap to be
performed. Possible values are "calibrate"
(for calibration of the
sample weights of the resampled observations in every iteration) and
"naive"
(for a naive bootstrap without calibration of the sample
weights).
if bootType
is "calibrate"
, a matrix of calibration
variables.
numeric; if bootType
is "calibrate"
, this gives
the population totals. If years
is NULL
, a vector should be
supplied, otherwise a matrix in which each row contains the population totals
of the respective year. If this is NULL
(the default), the population
totals are computed from the sample weights using the Horvitz-Thompson
estimator.
a character string specifying the type of confidence
interval(s) to be computed. Possible values are "perc"
, "norm"
and "basic"
(see boot.ci
).
a numeric value giving the significance level to be used for
computing the confidence interval(s) (i.e., the confidence level is \(1 -
\)alpha
), or NULL
.
optional; an integer value to be used as the seed of the random number generator, or an integer vector containing the state of the random number generator to be restored.
a logical indicating whether missing values should be removed.
either a numeric vector giving the gender, or (if data
is not NULL
) a character string, an integer or a logical vector
specifying the corresponding column of data
.
a character string specifying the method to be used (only for
gpg
). Possible values are "mean"
for the mean, and
"median"
for the median. If weights are provided, the weighted mean
or weighted median is estimated.
if bootType
is "calibrate"
, additional arguments
to be passed to calibWeights
.
Andreas Alfons
A. Alfons and M. Templ (2013) Estimation of Social Exclusion Indicators from Complex Surveys: The R Package laeken. Journal of Statistical Software, 54(15), 1--25. tools:::Rd_expr_doi("10.18637/jss.v054.i15")
variance
, calibWeights
,
arpr
, qsr
, rmpg
, gini
data(eusilc)
a <- arpr("eqIncome", weights = "rb050", data = eusilc)
## naive bootstrap
bootVar("eqIncome", weights = "rb050", design = "db040",
data = eusilc, indicator = a, R = 50,
bootType = "naive", seed = 123)
## bootstrap with calibration
bootVar("eqIncome", weights = "rb050", design = "db040",
data = eusilc, indicator = a, R = 50,
X = calibVars(eusilc$db040), seed = 123)
Run the code above in your browser using DataLab