Simple and stratified systematic sampling

Description

Select sampling units using simple or stratified systematic samplin. In the context of two-stage cluster sampling, select Secondary Sampling Units (SSU) in one or more Primary Sampling Units (PSU), using systematic sampling.

Usage

1
2

Arguments

psu.ssu

data.frame with all PSU. First column contains PSU unique identifiers. Second column contains numeric PSU sizes. Only used for the second stage of a two-stage cluster design (see details).

su

numeric indicating the number of sampling units to be selected. If su has more than one element, stratified sampling is applied and psu.ssu is ignored (see details).

N

numeric indicating the number of sampling units in the population. It is intended for simple or stratified sampling designs and when used, psu.ssu is ignored (see details).

write

logical. If TRUE, a *.csv file containing the PSU and their SSU is writed in the current working directory.

...

further arguments passed to write.table function.

Details

When N is defined, psu.ssu is ignored (not need to be defined). If N has one element, su must too and the result is a simple systematic selection. If N has more than one element, su must have the same number of elements and each oredered pair represent an strata. Thus, when N has more than one element, the result is a stratified sampling with systematic selection within each strata (see examples).

Value

A matrix. For the second stage in a two-stage cluster sampling, the names of columns are the identifiers of selected psu, coerced by as.character to avoid scientific notation in case the identifiers be of class numeric. The rows correspond to the selected SSU within each psu. For simple systematic sampling, the rows correspond to the selected sampling units. For stratified sampling, each column represent an strata and the rows correspond to the selected sampling units in each strata.

References

Levy P and Lemeshow S (2008). Sampling of populations: methods and applications, Fourth edition. John Wiley and Sons, Inc.

http://oswaldosantos.github.io/capm

See Also

SamplePPS.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Load data with PSU identifiers and sizes.
data(psu.ssu)

# Take a sample of 10 PSU, with probability 
# proportional to size and with replacement.
selected.psu <- SamplePPS(psu.ssu, 10, write = FALSE)

# Take a systematic sampling of 5 SSU within each 
# PSU of selected.psu.
SampleSystematic(selected.psu, 5, write = FALSE)

# Simple systematic sampling
SampleSystematic(su = 5, N = 100)

# Stratified systematic sampling
SampleSystematic(su = c('Urban' = 50, 'Rural' = 10),
                 N = c('Urban' = 4000, 'Rural' = 150))