Returns each unit's probability of being sampled under simple random sampling. Every unit is sampled independently, so the probabilities do not depend on which other units were drawn.
Usage
simple_rs_probabilities(
N,
prob = NULL,
prob_unit = NULL,
check_inputs = TRUE,
simple = TRUE
)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)
Details
These are the quantities inverse-probability weights are built from: weight
each sampled unit by the reciprocal of its inclusion probability, which
obtain_inclusion_probabilities() extracts for you.