Description Usage Arguments Value Examples
fpdustPPS
selects a sample of size n from a finite population given a spatial
contingency matrix, a parameter beta
, and a size variable vector.
1 |
spMat |
a matrix representing spatial contingency among population units,
with dimension |
X |
numeric vector with values of the size variable |
n |
integer scalar representing sample size |
beta |
a real number <1 representing a modifier of the probability of selection for units that are adjacent to already selected units |
a logical vector indicating which units have been selected (TRUE if selected, FALSE otherwise)
1 2 3 4 5 6 7 8 9 10 11 | # List of contiguous units ---
cl <- list( c(2, 3), c(1,4), c(1,6), c(2,6), NULL, c(3,4))
# Generate spatial contingency matrix ---
cm <- spatialContingencyMatrix(cl)
### Draw a FPDUST sample ---
fpdust(cm, n= 2, beta=0.5)
### Draw a PPS FPDUST sample ---
X <- rgamma(6, 20)
fpdustPPS(cm, X, n= 2, beta=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.