Skip to contents

All sampling functions in sondage return objects inheriting from class "sondage_sample". These objects store the realized sample together with the design-defining quantities needed by the query generics.

Details

sondage_sample objects always contain these fields:

$sample

Realized sample indices. For nrep = 1, an integer vector. For nrep > 1, a matrix for fixed-size designs or a list of integer vectors for random-size designs.

$n

Target or expected sample size. Integer for fixed-size designs; may be non-integer for random-size designs such as Poisson, Bernoulli, or stratified cube with non-integer stratum totals.

$N

Population size.

$method

Method name string used to generate the design.

$fixed_size

Logical flag indicating whether the realized sample size is fixed by design.

Without-replacement ("wor") objects additionally contain:

$pik

Design-defining inclusion probability vector. For methods with exact first-order guarantees, this equals the true first-order inclusion probabilities. For order-sampling methods such as "sps" and "pareto", this is the stored target vector.

With-replacement ("wr") objects additionally contain:

$prob

Selection probability vector for each draw.

$hits

Realized hit counts by unit. For nrep = 1, an integer vector of length N. For nrep > 1, an N x nrep integer matrix.

The class vector also records the design family:

c("equal_prob", "wor", "sondage_sample")

Equal-probability sampling without replacement.

c("equal_prob", "wr", "sondage_sample")

Equal-probability sampling with replacement.

c("unequal_prob", "wor", "sondage_sample")

Unequal-probability sampling without replacement, including balanced sampling.

c("unequal_prob", "wr", "sondage_sample")

Unequal-probability sampling with replacement or minimum replacement.