sb: Spatial balance

Description Usage Arguments Value References Examples

View source: R/RcppExports.R

Description

Calculates spatial balance of a sample subject to inclusion probabilities and auxiliary space

Usage

1
sb(p,x,s)	

Arguments

p

vector of length N with inclusion probabilities

x

matrix of (standardized) auxiliary variables of N rows and q columns

s

the sample, vector of length n

Value

Number, the spatial balance

References

Grafstr<c3><b6>m, A., Lundstr<c3><b6>m, N.L.P. and Schelin, L. (2012). Spatially balanced sampling through the Pivotal method. Biometrics 68(2), 514-520.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# check spatial balance
set.seed(1234567);
N = 500;
n = 70;
p = rep(n/N,N);
X = cbind(runif(N),runif(N));

# select lpm1 sample
s = lpm1(p,X);
# calculate balance
B = sb(p,X,s);


## End(Not run)

jlisic/BalancedSampling documentation built on May 19, 2019, 12:46 p.m.