samp: Stratified permanent random number sampling

Description Usage Arguments Value See Also Examples

Description

Wrapper for stratified simple random sampling (SRS) and probability-proportional-to-size (PPS) sampling using permanent random numbers. Can also be used for non-stratified sampling using a dummy stratum taking the same value for each object.

Usage

1
samp(method, df, ...)

Arguments

method

pps or srs.

df

Data frame containing the elements to sample from.

...

Further method-specific arguments.

Value

Copy of the input data frame together with the boolean variable sampled, as well as a numeric variable lambda containing the estimated first-order inclusion probabilities when PPS is used.

See Also

srs, pps, transformprn.

Examples

1
2
samp(method=pps, df=ExampleData, nsamp="nsamp", stratid="stratum", prn="prn", size="size")
samp(method=srs, df=ExampleData, nsamp="nsamp", stratid="stratum", prn="prn")

kirajcg/prnsamplr documentation built on May 17, 2019, 3:12 a.m.