The blocked weighted bootstrap (BBW) is an estimation technique for use with data from two-stage cluster sampled surveys in which either prior weighting (e.g. population proportional sampling or PPS as used in SMART surveys) or posterior weighting (e.g. as used in RAM and S3M surveys).
Arguments
- x
A
data.frame()
with primary sampling unit (PSU) in variable namedpsu
and at least one other variable containing data for estimation.- w
A
data.frame()
with primary sampling unit (PSU) in variable namedpsu
and survey weights (i.e. PSU population) in variable namedpop
.- statistic
Am estimator function operating on variables in
x
containing data for estimation. The functionsbootClassic()
andbootPROBIT()
are examples.- params
Parameters specified as names of columns in
x
that are to be passed to the function specified instatistic
.- outputColumns
Names to be used for columns in output
data.frame()
. Default to names specified inparams
.- replicates
Number of bootstrap replicates to be performed. Default is 400.
Value
A data.frame()
with:
number of columns equal to length of
outputColumns
;number of rows equal to number of
replicates
; and,`names equal to
outputColumns
.`
Examples
# Example call to bootBW function using RAM-OP test data:
bootBW(
x = indicatorsHH, w = villageData, statistic = bootClassic,
params = "anc1", outputColumns = "anc1", replicates = 9
)
#> ✔ x has the appropriate/expected data structure
#> anc1
#> 1 0.2150171
#> 2 0.2171083
#> 3 0.1870469
#> 4 0.2743321
#> 5 0.2274025
#> 6 0.2379344
#> 7 0.1991383
#> 8 0.2138425
#> 9 0.2233429
# Example estimate with 95% CI:
#quantile(bootP, probs = c(0.500, 0.025, 0.975), na.rm = TRUE)