pps {prnsamplr} | R Documentation |
Stratified probability-proportional-to-size sampling
Description
Stratified probability-proportional-to-size (PPS) sampling using permanent random numbers. Can also be used for non-stratified PPS using a dummy stratum taking the same value for each object.
Usage
pps(df, stratid, nsamp, prn, size)
Arguments
df |
Data frame containing the elements to sample from. |
stratid |
Variable in |
nsamp |
Variable in |
prn |
Variable in |
size |
Variable in |
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 and the numeric variable
Q = \frac{prn(1 - lambda)}{lambda(1 - prn)}
that determines which elements are sampled.
See Also
prnsamplr
,
samp
,
srs
,
transformprn
,
ExampleData
.
Examples
dfOut <- pps(df=ExampleData,
nsamp="nsample",
stratid="stratum",
prn="rands",
size="sizeM")