varSYG: Sen-Yates-Grundy variance estimator

Description Usage Arguments Details Value Difference with varHT from package sampling Author(s) Examples

Description

varSYG computes the Sen-Yates-Grundy variance estimator.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

gustave documentation built on Nov. 10, 2021, 5:08 p.m.