osod {StratifiedSampling} | R Documentation |
One-step One Decision sampling method
Description
This function implements the One-step One Decision method. It can be used using equal or unequal inclusion probabilities. The method is particularly useful for selecting a sample from a stream.
Usage
osod(pikr, full = FALSE)
Arguments
pikr |
A vector of inclusion probabilities. |
full |
An optional boolean value, to specify whether the full population (the entire vector) is used to update inclusion probabilities. Default: FALSE |
Details
The method sequentially transforms the vector of inclusion probabilities into a sample whose values are equal to 0 or 1. The method respects the inclusion probabilities and can handle equal or unequal inclusion probabilities.
The method does not take into account the whole vector of inclusion probabilities by having a sequential implementation. This means that the method is fast and can be implemented in a flow.
Value
A vector with elements equal to 0 or 1. The value 1 indicates that the unit is selected while the value 0 is for rejected units.
See Also
Examples
N <- 1000
n <- 100
pik <- inclprob(runif(N),n)
s <- osod(pik)