WFPBB {MSIMST}R Documentation

Weighted Finite Population Bayesian Bootstrap

Description

The function is implemented based on the WFPBB algorithm from (Gunawan et al. 2020).

Usage

WFPBB(y, w, N, n, verbatim)

Arguments

y

The index of survey data.

w

Survey weights. The summation of survey weights should equal the population size

N

The population size.

n

The sample size.

verbatim

TRUE/FALSE. This variable decides whether print the progress information to the console.

Value

The re-sampled index of survey data.

References

Gunawan D, Panagiotelis A, Griffiths W, Chotikapanich D (2020). “Bayesian weighted inference from surveys.” Australian & New Zealand Journal of Statistics, 62(1), 71–94. ISSN 1467-842X, doi:10.1111/anzs.12284.

Examples

set.seed(100)
output_data <- reg_simulation3(N = 5000,
                               ni_lambda= 8,
                               beta = c(rep(1,6),rep(0,4)),
                               beta_b = 1.5,
                               dsq = 0.1,
                               sigmasq = 0.5,
                               delta = 0.6,
                               nu = 5.89,
                               muz = 0,
                               rho = 36.0,
                               sigmasq_z = 0.6,
                               zeta0 = -1.8,
                               zeta1 = 0.1)
y <- output_data$y
X <- output_data$X
survey_weight <- output_data$survey_weight
# set the population size
population_N <- 5000
# set the sample size
n <- length(y)
# run the WFPBB algorithm
index_WFPBB <- WFPBB(y = 1:n,
                     w = survey_weight,
                     N = population_N,
                     n = n,
                     verbatim = FALSE)
print(head(index_WFPBB))


[Package MSIMST version 1.1 Index]