Learn Data & AI Skills | 50% off
Get 50% off unlimited learning

optimStrat (version 2.0)

varstsireg: Design variance of a STSI--reg sampling strategy.

Description

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.

Usage

varstsireg(y, stratum, nh, x)

Arguments

y

a numeric vector giving the values of the study variable.

stratum

a vector indicating the stratum to which each element belongs.

nh

a vector indicating the sample size of the stratum to which each element belongs.

x

a positive numeric vector giving the values of the auxiliary variable that is used at the estimation stage.

Value

A numeric value giving the variance of the regression estimator under Stratified Simple Random Sampling.

Details

A sample of size n is allocated into the strata using x-optimal allocation, i.e. nhNhSx,Uh where Nh is the size of the hth stratum, Sx,Uh is the standard deviation of x in the hth stratum and propto stands for ‘proportional to’.

If nh>Nh for at least one stratum, nh is set equal to Nh in those strata and optimal allocation is used again for the remaining strata with the remaining sample size.

Once the nh are obtained, the variance of the poststratified estimator under Stratified Simple Random Sampling is computed as: VSTSI[t^HT]=hVh with Vh=Nh2nh(1nhNh)SE,Uh2 where SE,Uh2 is the variance of E in the hth stratum with Ek=yky^k.

See Also

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.

Examples

Run this code
# 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