Learn R Programming

sampling (version 2.10)

srswor1: Selection-rejection method

Description

Draws a simple random sampling without replacement of size n using the selection-rejection method (equal probabilities, fixed sample size, without replacement).

Usage

srswor1(n,N)

Value

Returns a vector (with elements 0 and 1) of size N, the population size. Each element k of this vector indicates the status of unit k (1, unit k is selected in the sample; 0, otherwise).

Arguments

n

sample size.

N

population size.

References

Fan, C.T., Muller, M.E., Rezucha, I. (1962), Development of sampling plans by using sequential (item by item) selection techniques and digital computer, Journal of the American Statistical Association, 57, 387--402.

See Also

srswor

Examples

Run this code
s=srswor1(3,10)
#the sample is
which(s==1)

Run the code above in your browser using DataLab