UPSvarApprox provides functions for the approximation of the variance of the Horvitz-Thompson total estimator in Unequal Probability Sampling using only first-order inclusion probabilities.
The main functions are:
Var_approx()
: computes and approximation of the
variance of the HT estimator;approx_var_est()
: computes an approximate variance
estimate for the HT estimator;The development version of the package can be installed from GitHub:
# if not present, install 'devtools' package
install.packages("devtools")
::install_github("rhobis/UPSvarApprox") devtools
library(UPSvarApprox)
### Generate population data ---
<- 500; n <- 50
N
set.seed(0)
<- rgamma(500, scale=10, shape=5)
x <- abs( 2*x + 3.7*sqrt(x) * rnorm(N) )
y
<- n * x/sum(x)
pik <- sample(N, n)
s
<- y[s]
ys <- pik[s]
piks
### Variance approximations ---
Var_approx(y, pik, n, method = "Hajek1")
Var_approx(y, pik, n, method = "Hajek1")
Var_approx(y, pik, n, method = "HartleyRao1")
Var_approx(y, pik, n, method = "HartleyRao2")
Var_approx(y, pik, n, method = "FixedPoint")
### Approximate variance estimators ---
## Estimators of class 2
approx_var_est(ys, piks, method="Deville1")
approx_var_est(ys, piks, method="Deville2")
approx_var_est(ys, piks, method="Deville3")
approx_var_est(ys, piks, method="Rosen")
approx_var_est(ys, piks, method="FixedPoint")
approx_var_est(ys, piks, method="Brewer1")
## Estimators of class 3
approx_var_est(ys, pik, method="Berger", sample=s)
approx_var_est(ys, pik, method="Tille", sample=s)
approx_var_est(ys, pik, method="MateiTille1", sample=s)
approx_var_est(ys, pik, method="MateiTille2", sample=s)
approx_var_est(ys, pik, method="MateiTille3", sample=s)
approx_var_est(ys, pik, method="MateiTille4", sample=s)
approx_var_est(ys, pik, method="MateiTille5", sample=s)
approx_var_est(ys, pik, method="Brewer2", sample=s)
approx_var_est(ys, pik, method="Brewer3", sample=s)
approx_var_est(ys, pik, method="Brewer4", sample=s)
rob.sichera@gmail.com
.