VarHT: Variance of the Horvitz-Thompson Estimator

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/VarHT.r

Description

Computes the theoretical variance of the Horvitz-Thompson estimator given a without replacement fixed sample size design

Usage

1
VarHT(y, N, n, p)

Arguments

y

Vector containing the recollected information of the characteristic of interest for every unit in the population

N

Population size

n

Sample size

p

A vector containing the selection probabilities of a fixed size without replacement sampling design. The sum of the values of this vector must be one

Details

The variance of the Horvitz-Thompson estimator, under a given sampling design p, is given by

Var_p(\hat{t}_{y,π})=∑_{k\in U}∑_{l \in U}Δ_{kl}\frac{y_k}{π_k}\frac{y_l}{π_l}

Value

The function returns the value of the theoretical variances of the Horviz-Thompson estimator.

Author(s)

Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com

References

Sarndal, C-E. and Swensson, B. and Wretman, J. (1992), Model Assisted Survey Sampling. Springer.
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas.

See Also

HT, Deltakl, Pikl, Pik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Without replacement sampling
# Vector U contains the label of a population of size N=5
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
# Vector y1 and y2 are the values of the variables of interest
y1<-c(32, 34, 46, 89, 35)
y2<-c(1,1,1,0,0)
# The population size is N=5
N <- length(U)
# The sample size is n=2
n <- 2
# p is the probability of selection of every possible sample
p <- c(0.13, 0.2, 0.15, 0.1, 0.15, 0.04, 0.02, 0.06, 0.07, 0.08)

# Calculates the theoretical variance of the HT estimator
VarHT(y1, N, n, p)
VarHT(y2, N, n, p)

Example output

[1] 7847.211
[1] 2.342123

TeachingSampling documentation built on April 22, 2020, 1:05 a.m.