Learn R Programming

capm (version 0.3)

SamplePPS: Probability proportional to size sampling with replacement

Description

Select Primary Sampling Units (PSU) with probability proportional to size with replacement.

Usage

SamplePPS(psu.ssu = NULL, psu = NULL, write = FALSE, ...)

Arguments

psu.ssu
data.frame with all PSU. First column contains PSU unique identifiers. Second column contains numeric PSU sizes.
psu
the number of PSU to be selected.
write
logical. If TRUE, a *.csv file containing the PSU and their Secondary Sampling Units (SSU) is writed in the current working directory.
...
further arguments passed to write.table function.

Value

  • data.frame. First column contains the selected psu identifiers, coerced by as.character, to avoid scientific notation in case the identifiers be large numbers of class numeric. Second column contain PSU sizes, a variable needed for second stage sampling with SampleSystematic.

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

SampleSystematic.

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 with replacement.
(selected.psu <- SamplePPS(psu.ssu, 10, write = FALSE))

Run the code above in your browser using DataLab