vDBS: Variance Estimation for Doubly Balanced Sample.

View source: R/RcppExports.R

vDBSR Documentation

Variance Estimation for Doubly Balanced Sample.

Description

Variance estimator for sample that are at the same time well spread and balanced on auxiliary variables. See Grafstr\"om and Till\'e (2013)

Usage

vDBS(Xauxs, Xspreads, piks, ys)

Arguments

Xauxs

A matrix of size (n x p) of auxiliary variables on which the sample must be balanced.

Xspreads

Matrix of spatial coordinates.

piks

A vector of inclusion probabilities. The vector has the size n of the sample s.

ys

A variable of interest. The vector has the size n of the sample s.

Value

Estimated variance of the horvitz-thompson estimator.

Author(s)

Raphaël Jauslin raphael.jauslin@unine.ch

References

Grafstr\"om, A. and Till\'e, Y. (2013), Doubly balanced spatial sampling with spreading and restitution of auxiliary totals, Environmetrics, 14(2):120-131

See Also

vDBS vApp

Examples


N <- 100 
n <- 40
x1 <- rgamma(N,4,25)
x2 <- rgamma(N,4,25)

pik <- rep(n/N,N)
Xaux <- cbind(pik,as.matrix(matrix(c(x1,x2),ncol = 2)))
Xspread <- cbind(runif(N),runif(N))
  

s <- balseq(pik,Xaux,Xspread)
  
y <- Xaux%*%c(1,1,3) + rnorm(N,120) # variable of interest
  
vEst(Xaux[s,],pik[s],y[s])
vDBS(Xaux[s,],Xspread[s,],pik[s],y[s])
vApp(Xaux,pik,y)


StratifiedSampling documentation built on Oct. 26, 2022, 5:09 p.m.