varSYG {gustave}R Documentation

Sen-Yates-Grundy variance estimator

Description

varSYG computes the Sen-Yates-Grundy variance estimator.

Usage

varSYG(y = NULL, pikl, precalc = NULL)

Arguments

y

A (sparse) numerical matrix of the variable(s) whose variance of their total is to be estimated.

pikl

A numerical matrix of second-order inclusion probabilities.

precalc

A list of pre-calculated results (analogous to the one used by varDT).

Details

varSYG aims at being an efficient implementation of the Sen-Yates-Grundy variance estimator for sampling designs with fixed sample size. It should be especially useful when several variance estimations are to be conducted, as it relies on (sparse) matrix linear algebra.

Moreover, in order to be consistent with varDT, varSYG has a precalc argument allowing for the re-use of intermediary results calculated once and for all in a pre-calculation step (see varDT for details).

Value

Difference with varHT from package sampling

varSYG differs from sampling::varHT in several ways:

Author(s)

Martin Chevalier

Examples

library(sampling)
set.seed(1)

# Simple random sampling case
N <- 1000
n <- 100
y <- rnorm(N)[as.logical(srswor(n, N))]
pikl <- matrix(rep((n*(n-1))/(N*(N-1)), n*n), nrow = n)
diag(pikl) <- rep(n/N, n)
varSYG(y, pikl)
sampling::varHT(y = y, pikl = pikl, method = 2)

[Package gustave version 1.0.0 Index]