srswor {sampling}R Documentation

Simple random sampling without replacement

Description

Draw a simple random sampling without replacement of size n (equal probabilities, fixed sample size, without replacement).

Usage

srswor(n,N)

Arguments

n sample size.
N population size.

Details

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

See Also

sample, srswr

Examples

############
## Example 1
############
#select a sample
s=srswor(3,10)
#the sample is
(1:10)[s==1]
############
## Example 2
############
data(belgianmunicipalities)
Tot=belgianmunicipalities$Tot04
name=belgianmunicipalities$Commune
n=200
#select a sample
s=srswor(n,length(Tot))  
#the sample is 
as.vector(name[s==1])

[Package sampling version 0.3 Index]