Description Usage Arguments Details Value Author(s) References See Also Examples
Computes the theoretical variance of the Horvitz-Thompson estimator given a without replacement fixed sample size design
1 | VarHT(y, N, n, p)
|
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 |
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}
The function returns the value of the theoretical variances of the Horviz-Thompson estimator.
Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com
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.
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)
|
[1] 7847.211
[1] 2.342123
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.