Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

varHT

Variance estimators of the Horvitz-Thompson estimator


Description

Computes variance estimators of the Horvitz-Thompson estimator of the population total.

Usage

varHT(y,pikl,method)

Arguments

y

vector of the variable of interest; its length is equal to n, the sample size.

pikl

matrix of second-order inclusion probabilities; its dimension is nxn.

method

if 1, an unbiased variance estimator is computed; if 2, the Sen-Yates-Grundy variance estimator for fixed sample size is computed; be default, the method is 1.

Details

If method is 1, the following estimator is implemented

\widehat{Var}(\widehat{Y}_{HT})_1=∑_{k\in s}∑_{\ell\in s} \frac{y_k y_\ell}{π_{k\ell} π_k π_\ell}(π_{k\ell} - π_k π_\ell)

If method is 2, the following estimator is implemented

\widehat{Var}(\widehat{Y}_{HT})_2=\frac{1}{2}∑_{k\in s}∑_{\ell\in s} ≤ft(\frac{y_k}{π_k} - \frac{y_\ell}{π_\ell}\right)^2 \frac{π_k π_\ell-π_{k\ell}}{π_{k\ell}}

See Also

Examples

pik=c(0.2,0.7,0.8,0.5,0.4,0.4)
N=length(pik)
n=sum(pik)
# Defines the variable of interest
y=rnorm(N,10,2)
# Draws a Poisson sample of expected size n
s=UPpoisson(pik)
# Computes the Horvitz-Thompson estimator
HTestimator(y[s==1],pik[s==1])
# Computes the second-order inclusion prob. for Poisson sampling
pikl=outer(pik,pik,"*")
diag(pikl)=pik
# Computes the variance estimator (method=1, the sample size is not fixed)
varHT(y[s==1],pikl[s==1,s==1],1)
# Draws a Tille sample of size n
s=UPtille(pik)
# Computes the Horvitz-Thompson estimator
HTestimator(y[s==1],pik[s==1])
# Computes the second-order inclusion prob. for Tille sampling
pikl=UPtillepi2(pik)
# Computes the variance estimator (method=2, the sample size is fixed)
varHT(y[s==1],pikl[s==1,s==1],2)

sampling

Survey Sampling

v2.9
GPL (>= 2)
Authors
Yves Till<e9> <yves.tille@unine.ch>, Alina Matei <alina.matei@unine.ch>
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.