sps_repweights {sps} | R Documentation |
Produce bootstrap replicate weights that are appropriate for Poisson sampling, and therefore approximately correct for sequential Poisson sampling.
sps_repweights(w, B = 1000, tau = 1, dist = NULL)
w |
A numeric vector of design (inverse probability) weights for a (sequential) Poisson sample. |
B |
A positive integer that gives the number of bootstrap replicates (1,000 by default). Non-integers are truncated towards 0. |
tau |
A number greater than or equal to 1 that gives the rescale factor for the bootstrap weights. Setting to 1 (the default) does not rescale the weights. |
dist |
A function that produces random deviates with mean 0 and standard deviation 1, such as |
The details of the method for generating bootstrap replicates are presented by Beaumont and Patak (2012, sections 4 and 6). Their method takes a vector of design weights w
, finds a vector of adjustments a
for each bootstrap replicate, and calculates the replicate weights as a w
.
There are two ways to calculate the adjustments a
. The default pseudo-population method randomly rounds w
for each replicate to produce a collection of integer weights w'
that are used to generate a random vector b
from the binomial distribution. The vector of adjustments is then a = 1 + b - w' / w
. Specifying a deviates-generating function for dist
uses this function to make a random vector d
that is then used to make an adjustment a = 1 + d \sqrt{1 - 1 / w}
.
These adjustments can be rescaled by a value \tau \geq 1
to prevent negative replicate weights. With this rescaling, the adjustment becomes (a + \tau - 1) / \tau
. If \tau > 1
then the resulting bootstrap variance estimator should be multiplied by \tau^2
.
As an alternative to the bootstrap, Ohlsson (1998, equations 2.13) proposes an analytic estimator for the variance of the total \hat Y = \sum wy
(for the take-some units) under sequential Poisson sampling:
V(\hat Y) = \frac{n}{n - 1} \sum \left(1 - \frac{1}{w}\right) \left(wy - \frac{\hat Y}{n}\right)^2.
See Rosén (1997, equation 3.11) for a more general version of this estimator that can be applied to other order sampling schemes. Replacing the left-most correction by n / (m - 1)
, where m
is the number of units in the sample, gives a similar estimator for ordinary Poisson sampling.
A matrix of bootstrap replicate weights with B
columns (one for each replicate) and length(w)
rows (one for each unit in the sample), with the value of tau
as an attribute.
Beaumont, J.-F. and Patak, Z. (2012). On the Generalized Bootstrap for Sample Surveys with Special Attention to Poisson Sampling. International Statistical Review, 80(1): 127-148.
Ohlsson, E. (1998). Sequential Poisson Sampling. Journal of Official Statistics, 14(2): 149-162.
Rosén, B. (1997). On sampling with probability proportional to size. Journal of Statistical Planning and Inference, 62(2): 159-191.
sps
for drawing a sequential Poisson sample.
bootstrapFP
(with method = "wGeneralised"
) in the bootstrapFP package for calculating the variance of Horvitz-Thompson estimators using the generalized bootstrap.
# Make a population with units of different size
x <- c(1:10, 100)
# Draw a sequential Poisson sample
(samp <- sps(x, 5))
# Make some bootstrap replicates
dist <- list(
pseudo_population = NULL,
standard_normal = rnorm,
exponential = \(x) rexp(x) - 1,
uniform = \(x) runif(x, -sqrt(3), sqrt(3))
)
lapply(dist, sps_repweights, w = weights(samp), B = 5, tau = 2)