fpdustPPS: Select a sample from a finite population using a modified...

Description Usage Arguments Value Examples

View source: R/fpdustPPS.R

Description

fpdustPPS selects a sample of size n from a finite population given a spatial contingency matrix, a parameter beta, and a size variable vector.

Usage

1
fpdustPPS(spMat, X, n, beta)

Arguments

spMat

a matrix representing spatial contingency among population units, with dimension NxN and whose values are 1's (adjacent units) or 0's (otherwisex)

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

Value

a logical vector indicating which units have been selected (TRUE if selected, FALSE otherwise)

Examples

 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)

rhobis/FPdust documentation built on May 29, 2021, 8:36 a.m.