Sampling design (source code)

= Sampling design
{title2=$p(s)=\mathbb P(S=s)$}

A \b[<sampling design>] specifies a <probability distribution> over the possible samples from a defined population:
$$
p(s)=\mathbb P(S=s),\qquad p(s)\geq0,\qquad\sum_s p(s)=1.
$$
For sampling distinct labelled units, $s$ is a subset of the population. The design includes the selection mechanism, not merely the final <sample size>. A procedure with repeated draws can instead require a distribution over ordered sequences; the resulting inclusion probabilities concern whether a label appears at least once.

The design determines <inclusion probabilities> and <joint inclusion probabilities> through
$$
\pi_i=\sum_{s:i\in s}p(s),\qquad
\pi_{ij}=\sum_{s:i,j\in s}p(s).
$$
These connect the physical sampling procedure to the <Horvitz-Thompson estimator> and its <sampling variance>.<A Generalization of Sampling Without Replacement From a Finite Universe by D. G. Horvitz and D. J. Thompson>[1952, general unequal-probability sampling without replacement]{ref}

An original comparison uses four fixed values $(0,0,10,10)$ and selects two units. Under <simple random sampling>, every one of the six pairs has probability $1/6$. Each $\pi_i=1/2$, so the <Horvitz-Thompson estimator> is twice the selected sum. It takes values $0,20,40$ with probabilities $1/6,4/6,1/6$. Its <expected value> is the true <finite population total> $20$, and its <variance> is
$$
\frac16(0-20)^2+\frac46(20-20)^2+\frac16(40-20)^2=\frac{400}{3}.
$$
A second design chooses only $\{1,2\}$ or $\{3,4\}$, each with probability $1/2$. It has the same <sample size> and the same individual <inclusion probabilities>, but the estimator is now $0$ or $40$, giving <variance> $400$. Pair selection matters even when individual representation agrees.

A third design chooses uniformly among the four pairs containing one label from each of those two groups. Its total estimate is always $20$ for this particular population. This illustrates the potential gain from <stratified sampling> when groups correspond to relevant variation, not a claim that the third design dominates for every possible population. A reproducible design records the eligible labels and actual random selection rule before interpreting the observed sample.