Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

srswr

Simple random sampling with replacement


Description

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

Usage

srswr(n,N)

Arguments

n

sample size.

N

population size.

Value

Returns a vector of size N, the population size. Each element k of this vector indicates the number of replicates for unit k in the sample.

See Also

Examples

s=srswr(3,10)
#the selected units are 
(1:10)[s!=0]
#with the number of replicates 
s[s!=0]

sampling

Survey Sampling

v2.9
GPL (>= 2)
Authors
Yves Till<e9> <yves.tille@unine.ch>, Alina Matei <alina.matei@unine.ch>
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.