
Compute the design variance of the Horvitz-Thompson estimator of the total of y
under Stratified Simple Random Sampling, where strata are indicated by stratum
and the sample sizes by stratum are given by nh
.
varstsi(y,stratum,nh)
a numeric vector giving the values of the study variable.
a vector indicating the stratum to which each element belongs.
a vector indicating the sample size of the stratum to which each element belongs.
A numeric value giving the variance of the Horvitz-Thompson estimator under Stratified Simple Random Sampling.
The variance of the Horvitz-Thompson estimator under Stratified Simple Random Sampling is computed as: y
in the
The variance of Simple Random Sampling is computed if stratum
is a constant.
Sarndal, C.E., Swensson, B. and Wretman, J. (1992). Model Assisted Survey Sampling. Springer.
stratify
for a method to define the strata; optiallo
for Neyman optimal allocation of the sample; varpips
for the variance of the Horvitz-Thompson estimator under probability proportional-to-size sampling; varpipspos
for the variance of the poststratified estimator under probability proportional-to-size sampling; varstsipos
for the variance of the poststratified estimator under stratified simple random sampling; varpipsreg
for the variance of the regression estimator under probability proportional-to-size sampling; varstsireg
for the variance of the regression estimator under stratified simple random sampling.
# NOT RUN {
x<- 1 + sort( rgamma(5000, shape=4/9, scale=108) ) #simulating the auxiliary variable
st1<- optiallo(n=100,x=x^0.75,H=6)
y<- simulatey(x,b0=10,b1=1,b2=1.25,b4=0.75,rho=0.95)
varstsi(y,stratum=st1$stratum,nh=st1$nh)
# }
Run the code above in your browser using DataLab