Learn R Programming

StratifiedSampling (version 0.4.1)

osod: 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)

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.

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

Author

Raphael Jauslin raphael.jauslin@unine.ch

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.

See Also

c_bound

Examples

Run this code

N <- 1000
n <- 100
pik <- inclprob(runif(N),n)
s <- osod(pik)

Run the code above in your browser using DataLab