# desvar: Design variance In optimStrat: Choosing the Sample Strategy

## Description

Compute the design variance of six sampling strategies.

## Usage

 `1` ```desvar(y, x, n, H, d2, d4) ```

## Arguments

 `y` a numeric vector giving the values of the study variable. `x` a positive numeric vector giving the values of the auxiliary variable. `n` a positive integer indicating the desired sample size. `H` a positive integer giving the desired number of strata/poststrata. `d2` a number giving the assumed shape of the trend term in the superpopulation model. `d4` a number giving the assumed shape of the spread term in the superpopulation model.

## Details

The design variance of a sample of size `n` is computed for six sampling strategies (stsi–HT, πps–HT, stsi–pos, πps–pos, stsi–reg and πps–pos). The strategies are defined assuming that there is an underlying superpopulation model of the form

Y_k = δ_0 + δ_1 x_k^δ_2 + ε_k

with Eε_k=0, Vε_k=δ_3^2 x_k^2δ_4 and Cov(ε_k,ε_l)=0.

The number of strata/poststrata is given by `H`.

## Value

A vector of length six with the variance of the six sampling strategies.

## References

Bueno, E. (2018). A Comparison of Stratified Simple Random Sampling and Probability Proporional-to-size Sampling. Research Report, Department of Statistics, Stockholm University 2018:6. http://gauss.stat.su.se/rr/RR2018_6.pdf.

`expvar` for the expected variance of five sampling strategies.
 ```1 2 3 4 5 6 7``` ```f<- function(x,b0,b1,b2,...) {b0+b1*x^b2} g<- function(x,b3,...) {x^b3} x<- 1 + sort( rgamma(5000, shape=4/9, scale=108) ) y<- simulatey(x,f,g,dist="gamma",b0=10,b1=1,b2=1.25,b3=0.5,rho=0.90) desvar(y,x,n=500,H=6,d2=1.25,d4=0.50) desvar(y,x,n=500,H=6,d2=1.00,d4=1.00) ```