| design_variance | R Documentation |
Horvitz-Thompson estimate of the population total of y from a
select_units() sample, with the variance estimator that matches the
design: the local-mean estimator of Grafström and Schelin (2014) for
spatially balanced samples (it needs no joint inclusion probabilities),
the variance among replicate estimates for replicated systematic samples,
and the simple-random-sampling formula for equal-probability simple random
samples. A systematic sample drawn as a single replicate has no unbiased
design-based variance estimator; the local-mean estimator is used as the
customary approximation. The simple-random-sampling variance of the same
sample is always reported as a reference.
design_variance(sample, y, neighbours = 3L)
sample |
A |
y |
Column of the study variable (observed on the sampled units; other
rows may be |
neighbours |
Number of nearest sampled units in the neighbourhood of the local-mean estimator. |
The local-mean estimator averages over each sampled unit and its
neighbours nearest sampled units (ties included), as
BalancedSampling::vsb() does with its default k = 3. In the package's
experiments (three frames, Gaussian fields at four spatial ranges) it is
close to unbiased when the variable has no spatial structure and
conservative when it is smooth; the replicate estimator is unbiased but has
only -1 degrees of freedom, so intervals should use the t quantile with
df (reported) rather than the normal one.
A one-row tibble: total, variance, se, cv, variance_srs,
n, N, variance_method and df (degrees of freedom of the variance
estimate: -1 with r replicates, the number of sampled units minus
the number of strata otherwise).
Grafström, A. and Schelin, L. (2014). How to select representative samples. Scandinavian Journal of Statistics, 41(2), 277–290.
set.seed(2)
frame <- data.frame(x = runif(80), y = runif(80))
frame$crop <- 10 + 20 * frame$x + rnorm(80)
s <- select_units(frame, n = 20)
design_variance(s, y = "crop")
r <- select_units(frame, n = 20, method = "systematic", replicates = 4)
design_variance(r, y = "crop")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.