Compute the design variance of the poststratified estimator of the total of y
under Stratified Simple Random Sampling, where strata are indicated by stratum
and the sample of size n
is allocated using Neyman allocation with respect to x
.
varstsireg(y, stratum, nh, x)
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 positive numeric vector giving the values of the auxiliary variable that is used at the estimation stage.
A numeric value giving the variance of the regression estimator under Stratified Simple Random Sampling.
A sample of size x
in the
If
Once the E
in the
varpips
for the variance of the Horvitz-Thompson estimator under probability proportional-to-size sampling; varstsi
for the variance of the Horvitz-Thompson estimator under stratified simple random 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.
# NOT RUN {
x<- 1 + sort( rgamma(5000, shape=4/9, scale=108) ) #simulating the auxiliary variable
strat1<- optiallo(n=150,x^0.75,H=6)
y<- simulatey(x,b0=10,b1=1,b2=1.25,b4=0.75,rho=0.95)
varstsireg(y, stratum=strat1$stratum,nh=strat1$nh,x=x^1.25)
# }
Run the code above in your browser using DataLab