S.BE {TeachingSampling}R Documentation

Bernoulli Sampling Without Replacement

Description

Draws a Bernoulli sample withtout replacement of expected size $n$ from a population of size $N$

Usage

S.BE(N, prob)

Arguments

N Population size
prob Inclusion probability for each unit in the population

Details

The selected sample is drawn acording to a sequential procedure algorithm based on an uniform distribution. The Bernoulli sampling design is not a fixed sample size one.

Value

The function returns a vector of size N. Each element of this vector indicates if the unit was selected. Then, if the value of this vector for unit k is zero, the unit k was not selected in the sample; otherwise, the unit was selected in the sample.

Author(s)

Hugo Andrés Gutiérrez Rojas hugogutierrez@usantotomas.edu.co

References

Sarndal, C-E. and Swensson, B. and Wretman, J. (1992), Model Assisted Survey Sampling. Springer.
Guti'errez, H. A. (2009), Estrategias de muestreo: Dise~no de encuestas y estimaci'on de par'ametros. Editorial Universidad Santo Tom'as.
Till'e, Y. (2006), Sampling Algorithms. Springer.

See Also

E.BE

Examples

############
## Example 1
############
# Vector U contains the label of a population of size N=5
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
# Draws a Bernoulli sample without replacement of expected size n=3
# The inlusion probability is 0.6 for each unit in the population
sam <- S.BE(5,0.6)
sam
# The selected sample is
U[sam]

############
## Example 2
############
# Uses the Marco and Lucy data to draw a Bernoulli sample
data(Marco)
data(Lucy)
attach(Lucy)
N <- dim(Marco)[1]
# The population size is 2396. If the expected sample size is 400,
# then, the inclusion probability must be 400/2396=0.1669
sam <- S.BE(N,0.1669)
# The information about the units in the sample is stored in an object called data
data <- Lucy[sam,]
data
dim(data)

[Package TeachingSampling version 0.7.6 Index]