simple_rs draws a sample in which every unit is included or not independently of the others, as a separate coin flip. Because the draws are independent, the size of the realized sample varies from draw to draw. For most applications in which the size of the sampling frame is known in advance, complete_rs() is preferable because it fixes the number of units sampled.
Arguments
- N
The number of units in the sampling frame. Must be a positive integer. (required)
- prob
The probability of being sampled; must be a real number between 0 and 1 inclusive and of length 1. (optional)
- prob_unit
The probability of being sampled for each unit; must be a real number between 0 and 1 inclusive and of length N. Because units are drawn independently, this probability may differ from unit to unit. (optional)
- check_inputs
Logical. Whether to verify before sampling that the arguments are internally consistent: that probabilities lie between 0 and 1, that vectors are of length N, and that only one of
probandprob_unitis supplied. Defaults toTRUE. Set toFALSEto skip the checks when drawing many samples from arguments that have already been verified; declaring the design once withdeclare_rs()and drawing from it withdraw_rs()does this for you. (optional)- simple
Logical. Internal use only; leave at its default.
simple_rsalways draws units independently, and this argument exists so that the argument checker knows as much. (optional)