Functions to be used within variance estimation wrappers in order to perform on-the-fly linearizations (see Details).
total(y, by = NULL, where = NULL, ...)ratio(num, denom, by = NULL, where = NULL, ...)
mean(y, by = NULL, where = NULL, ...)
diff_of_ratio(num1, denom1, num2, denom2, by = NULL, where = NULL, ...)
ratio_of_ratio(num1, denom1, num2, denom2, by = NULL, where = NULL, ...)
A vector corresponding to the (sole) variable to estimate variance on. If not numeric (character or factor), it is automatically discretized.
Factor vector (character vectors are coerced to factors) whose levels are used to break down the estimation by domains.
Logical vector indicating the domain to perform variance estimation on.
Technical parameters passed on to helper functions within the linearization wrapper.
Numerical vector(s) corresponding to the numerator(s) to be used in the estimation.
Numerical vector(s) corresponding to the denominator(s) to be used in the estimation.
When the estimator is not the estimator of a total, the application of analytical variance estimation formulae developed for the estimator of a total is not straightforward (Deville, 1999). An asymptotically unbiased variance estimator can nonetheless be obtained if the estimation of variance is performed on a variable obtained from the original data through a linerization step.
The ratio
, mean
, diff_of_ratio
and
ratio_of_ratio
functions implement the standard linearization
techniques respectively for the ratio, mean, difference of ratios and
ratio of ratios estimators, as presented for example in (Caron, 1998).
The total
function does not perform any linearization
(as none is needed for the estimator of a total) and solely adds the technical
features required to use the linearization wrapper within the variance wrappers
.
Caron N. (1998), "Le logiciel Poulpe : aspects m<U+00E9>thodologiques", Actes des Journ<U+00E9>es de m<U+00E9>thodologie statistique http://jms-insee.fr/jms1998s03_1/
Deville J.-C. (1999), "Variance estimation for complex statistics and estimators: linearization and residual techniques", Survey Methodology, 25:193<U+2013>203
# NOT RUN {
# See define_variance_wrapper examples
# }
Run the code above in your browser using DataLab