Learn R Programming

capm (version 0.3)

SampleSystematic: Systematic sampling

Description

Select sampling units using 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

SampleSystematic(psu.ssu = NULL, ssu = NULL, total = NULL,
  write = FALSE, ...)

Arguments

psu.ssu
data.frame with all PSU. First column contains PSU unique identifiers. Second column contains numeric PSU sizes.
ssu
numeric indicating SSU to be selected.
total
numeric indicating the number of sampling units in the population. This is an alternative to psu.ssu, intended for simple sampling designs.
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.

Value

  • A matrix. 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.

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

Run this code
# 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 sistematic sampling of 5 SSU within each
# PSU of selected.psu.
(selected.ssu <- SampleSystematic(selected.psu, 5, write = FALSE))

# Simple systematic sampling
(simp.syst.sampling <- SampleSystematic(ssu = 5, total = 100))

Run the code above in your browser using DataLab