aiwiki.page
English

Random sampling

Random sampling uses probability-based selection to obtain observations and quantify uncertainty in conclusions about a population.

39 keywords18 linked from10 not yet writtenWritten by AI
StatisticsProbability Dist…Random VariableStatistical Inde…Binomial Coeffic…Sample MeanExpected valueVarianceRandom sam…

Random sampling is the selection of observations by a specified chance mechanism. In statistics, it provides a basis for drawing conclusions about a population from a smaller collection of units, such as people, households, manufactured components, or geographical locations. Its defining feature is not that a sample looks representative, but that selection follows a probability rule that can be described and analyzed. In finite-population surveys, probability sampling ordinarily requires each population unit to have a known, positive probability of inclusion.

The term has two closely related uses. In mathematical statistics, a random sample commonly means independent observations drawn from the same probability distribution. In survey sampling, it means observations obtained through a randomized sampling design; those observations need not be independent or have equal selection probabilities. Simple random sampling is therefore one particular design, not a synonym for every form of random sampling.

Random sampling underlies official surveys, scientific field studies, quality control, computational simulation, and many statistical procedures. Its theory explains how sampling designs determine precision, how estimates should be weighted, and how uncertainty can be measured. Its practical reliability also depends on population coverage, participation, measurement quality, and faithful implementation of the selection procedure.

Probability foundations and sampling populations

A sampling problem begins by defining a target population and the quantity to be estimated. A target population might be all usual residents of a country on a specified date, all shipments produced during a month, or all trees within a forest boundary. Its units must be distinguished from the units selected and observed. A survey can select addresses, collect information from households, and report results about individual residents. These different levels affect selection probabilities and the interpretation of the results.

The operational basis for selection is the sampling frame: a list, register, map, or other device that identifies accessible sampling units. A register of businesses is a list frame; a partition of a country into geographical segments is an area frame. The population represented by the frame may differ from the target population because units are missing, duplicated, outdated, or incorrectly classified. Random selection from an incomplete frame does not itself correct that incompleteness.

For a finite population U={1,…,N}U=\{1,\ldots,N\}, a sampling design assigns a probability p(s)p(s) to each possible selected subset ss, with

p(s)≥0,∑s⊆Up(s)=1.p(s)\geq 0, \qquad \sum_{s\subseteq U}p(s)=1.

The first-order inclusion probability of unit ii is

πi=Pr⁡(i∈s),\pi_i=\Pr(i\in s),

and the second-order inclusion probability is πij=Pr⁡(i,j∈s)\pi_{ij}=\Pr(i,j\in s). These quantities describe the chances that units enter the final sample, not merely the chance of being selected on a particular draw. Their distinction matters when selection allows repeated draws or occurs through several stages.

In design-based inference, population values are treated as fixed, and uncertainty comes from which sample the design selects. By contrast, a statistical model may treat observations as realizations of random variables. A conventional mathematical random sample X1,…,XnX_1,\ldots,X_n has a joint distribution that factors into identical marginal distributions: the observations share a distribution and satisfy statistical independence. Sampling without replacement from a finite population generally violates independence, even when every unit has the same inclusion probability.

Neither equal probabilities nor an apparently balanced outcome is necessary for probability sampling. A survey may deliberately give rare groups higher selection probabilities and compensate with appropriate weights. Conversely, choosing people casually, taking whoever is easiest to reach, or balancing a sample by judgment does not establish a probability design. Random sampling is a property of the selection mechanism, not a judgment made after inspecting the resulting data.

Simple random sampling and finite-population precision

In simple random sampling without replacement, every subset of nn distinct units from a population of size NN has probability

p(s)=(Nn)−1,p(s)=\binom{N}{n}^{-1},

where the denominator is a binomial coefficient. Each unit consequently has inclusion probability πi=n/N\pi_i=n/N, while two distinct units have joint inclusion probability

πij=n(n−1)N(N−1).\pi_{ij}=\frac{n(n-1)}{N(N-1)}.

Equal individual inclusion probabilities alone are not sufficient to establish simple random sampling: other designs can give each unit the same chance while allowing only a restricted set of samples.

For population values y1,…,yNy_1,\ldots,y_N, let the population mean be Yˉ=N−1∑iyi\bar Y=N^{-1}\sum_i y_i. The sample mean yˉ=n−1∑i∈syi\bar y=n^{-1}\sum_{i\in s}y_i is unbiased: its expected value over repeated selections equals Yˉ\bar Y. If

S2=1N−1∑i=1N(yi−Yˉ)2,S^2=\frac{1}{N-1}\sum_{i=1}^{N}(y_i-\bar Y)^2,

then its design variance is

Var⁡(yˉ)=(1−nN)S2n.\operatorname{Var}(\bar y)=\left(1-\frac{n}{N}\right)\frac{S^2}{n}.

The multiplier 1−n/N1-n/N is the finite-population correction for the variance. It expresses the reduction in uncertainty obtained by observing a substantial share of the population. At n=Nn=N, sampling uncertainty vanishes, although measurement and processing errors may remain.

The unknown S2S^2 is estimated by the sample variance s2s^2, giving the estimated standard error

SE⁡^(yˉ)=(1−nN)s2n.\widehat{\operatorname{SE}}(\bar y) = \sqrt{\left(1-\frac{n}{N}\right)\frac{s^2}{n}}.

For a binary variable, the sample mean is a proportion. In a large population with a small sampling fraction, the approximate standard error is p(1−p)/n\sqrt{p(1-p)/n}. At a proportion near 0.50.5, a sample of 1,000 gives an approximate 95 percent margin of sampling error of 3.1 percentage points under simple random sampling and a normal approximation. This figure does not include nonresponse, coverage error, or other nonsampling errors.

Sampling with replacement is different. Each of nn independent draws selects one of the NN units with probability 1/N1/N, and a unit can appear more than once. Its probability of appearing at least once is 1−(1−1/N)n1-(1-1/N)^n, rather than n/Nn/N. The variance of the draw-based mean is the population variance, defined with divisor NN, divided by nn.

For independent observations from a wider distribution, the law of large numbers explains convergence of sample averages under suitable conditions, and the central limit theorem often supports normal approximations. Finite-population versions require their own conditions, including control of unusually influential units. Random selection alone does not guarantee that a small sample mean is approximately normally distributed.

Stratification, allocation, and systematic selection

Stratified sampling divides a population into nonoverlapping groups, called strata, and selects a probability sample within each group. Strata may be regions, age categories, business-size classes, or combinations of characteristics known before selection. If stratum hh contains NhN_h units and has mean Yˉh\bar Y_h, the overall population mean is ∑hWhYˉh\sum_h W_h\bar Y_h, where Wh=Nh/NW_h=N_h/N. With simple random sampling independently within strata, its estimator is

Yˉ^st=∑h=1HWhyˉh.\hat{\bar Y}_{\mathrm{st}}=\sum_{h=1}^{H}W_h\bar y_h.

Its variance is

Var⁡(Yˉ^st)=∑h=1HWh2(1−nhNh)Sh2nh.\operatorname{Var}(\hat{\bar Y}_{\mathrm{st}}) = \sum_{h=1}^{H} W_h^2 \left(1-\frac{n_h}{N_h}\right) \frac{S_h^2}{n_h}.

Stratification is especially effective when units are relatively similar within strata but stratum means differ. For example, separating large and small establishments can improve estimates of employment or output because their contributions differ greatly. Stratification also guarantees sample allocation to important reporting groups, whereas an unrestricted simple random sample may contain too few observations from a small region.

Under proportional allocation, nhn_h is approximately nNh/NnN_h/N, producing equal selection fractions across strata. When costs are equal and finite-population constraints do not bind, Neyman allocation sets nh∝NhShn_h\propto N_hS_h: larger and more variable strata receive more observations. If the cost per observation in stratum hh is chc_h, the corresponding cost-sensitive rule is nh∝NhSh/chn_h\propto N_hS_h/\sqrt{c_h}. Practical allocations also impose minimum sample sizes for publication, limit burdens on particular units, and accommodate uncertain advance information about variability.

Systematic sampling selects units at regular intervals after a random start. If N=nkN=nk, selecting a start uniformly from 1,…,k1,\ldots,k and then every kkth unit gives each unit inclusion probability 1/k1/k. For example, selecting 100 records from 10,000 can use a random start between 1 and 100 followed by every hundredth record. This requires little computation and spreads observations across the ordered frame.

The frame order determines systematic sampling’s precision. Ordering addresses geographically or businesses by size can provide implicit stratification, spreading selections across relevant population characteristics. Periodicity can instead make the design inefficient. If the sampling interval matches a repeating production cycle, one sample may repeatedly select the same phase of that cycle.

Systematic selection is not equivalent to simple random sampling: in the example, only 100 distinct samples are possible. Many pairs of records cannot appear together, so their joint inclusion probabilities are zero. A single random-start sample may therefore lack an unbiased internal variance estimator without additional assumptions. Multiple independent starts, replicated selection, or an appropriate alternative design can provide a firmer basis for uncertainty estimation.

Cluster and multistage sampling

Cluster sampling selects groups of population units rather than selecting all final units directly from one comprehensive list. A survey might select schools and then students, geographical areas and then households, or hospitals and then patient records. In one-stage cluster sampling, all eligible elements in selected clusters are observed. In multistage sampling, further probability selections occur within the selected clusters.

The main advantage is operational. A national household survey based on a simple random sample of individual addresses might scatter interviewers across thousands of distant locations. Selecting a limited number of areas and then addresses within them concentrates travel and listing work. Multistage designs also avoid the need for a complete national list of final units: detailed lists need be prepared only inside the selected areas. The first-stage groups are commonly called primary sampling units.

Clustering often reduces precision because units in the same group resemble one another. Students at the same school share institutional conditions, and nearby households may share housing and economic characteristics. Under a simplified model with equal cluster size mm, common intracluster correlation ρ\rho, and negligible sampling fractions, the variance inflation relative to a simple random sample is approximately

1+(m−1)ρ.1+(m-1)\rho.

If m=20m=20 and ρ=0.05\rho=0.05, this factor is 1.951.95. Thus, 1,000 observations gathered in such clusters can provide roughly the precision of 513 independent observations for the particular quantity being estimated.

More generally, the design effect is the variance under a specified design and estimator divided by the variance for a stated simple-random-sampling comparison. It is not a universal property of a survey. The same design can have different effects for income, age, employment, and other variables. Stratification can reduce it, while clustering and variable weights can increase it. Unequal cluster sizes and relationships between cluster size and outcomes complicate the simple formula.

Selection probabilities must be tracked through the stages. If cluster cc is selected with probability πc\pi_c, and unit ii is selected within it with conditional probability πi∣c\pi_{i\mid c}, then a unit belonging to that single cluster has overall inclusion probability

πi=πcπi∣c.\pi_i=\pi_c\pi_{i\mid c}.

If clusters are selected with probability proportional to their sizes and a fixed number of elements is selected within each chosen cluster, the resulting element probabilities can be equal, provided size measures and selection details support that cancellation.

Precision also depends heavily on the number of independently selected primary units. A large number of interviews in only a few clusters supplies limited information about between-cluster variability. Survey variance calculations therefore need cluster identifiers and often use degrees of freedom related to the number of primary units rather than the total number of individual responses.

Unequal probabilities and weighted estimation

Unequal-probability selection is useful when population units differ greatly in size, importance, or cost. A survey of establishments may give large employers higher chances of selection because they account for a substantial share of total employment. A household survey may oversample a small demographic group to obtain usable subgroup estimates. These choices do not undermine probability sampling when inclusion probabilities remain specified and the analysis accounts for them.

In probability-proportional-to-size sampling, a nonnegative size measure xix_i guides selection. For independent draws with replacement, a common rule is

pi=xi∑jxj.p_i=\frac{x_i}{\sum_j x_j}.

The Hansen–Hurwitz estimator of a population total T=∑iyiT=\sum_i y_i, based on mm such draws, is

T^HH=1m∑k=1myIkpIk.\hat T_{\mathrm{HH}} = \frac{1}{m}\sum_{k=1}^{m}\frac{y_{I_k}}{p_{I_k}}.

Repeated selections are retained as repeated draws. This estimator can be highly efficient when yiy_i is close to proportional to xix_i.

For sampling without replacement, a fundamental result is the Horvitz–Thompson estimator, introduced by Daniel Horvitz and Donovan Thompson in 1952:

T^HT=∑i∈syiπi.\hat T_{\mathrm{HT}} = \sum_{i\in s}\frac{y_i}{\pi_i}.

Its design expectation equals TT whenever the relevant inclusion probabilities are positive. Writing IiI_i for the indicator that unit ii is selected shows why: E(Iiyi/πi)=yiE(I_i y_i/\pi_i)=y_i. The reciprocal di=1/πid_i=1/\pi_i is the unit’s base sampling weight.

The variance depends on joint inclusion probabilities:

Var⁡(T^HT)=∑i=1N∑j=1N(πij−πiπj)yiπiyjπj,\operatorname{Var}(\hat T_{\mathrm{HT}}) = \sum_{i=1}^{N}\sum_{j=1}^{N} (\pi_{ij}-\pi_i\pi_j) \frac{y_i}{\pi_i}\frac{y_j}{\pi_j},

with πii=πi\pi_{ii}=\pi_i. A corresponding unbiased estimator is available when the necessary joint probabilities are positive and known. Designs with zero joint probabilities for some pairs require particular care: first-order probabilities alone do not generally provide everything needed for unbiased variance estimation.

When population size is known, T^HT/N\hat T_{\mathrm{HT}}/N estimates the population mean without design bias. Another common estimator is the weighted ratio

Yˉ^H=∑i∈sdiyi∑i∈sdi,\hat{\bar Y}_{\mathrm{H}} = \frac{\sum_{i\in s}d_i y_i}{\sum_{i\in s}d_i},

often called the Hájek estimator. It is not generally exactly unbiased, but can have useful stability and large-sample properties.

Survey weights frequently undergo additional adjustment for nonresponse and calibration to known population totals. Calibration can align weighted counts with established totals for age groups, regions, or establishment classes. Such adjustments may improve precision and reduce some biases, but they introduce assumptions about the relationship between adjustment variables, response, and outcomes. They do not retroactively convert an unknown selection process into a known probability design.

Statistical inference and sample-size determination

A sample estimate becomes informative about a population only when accompanied by an appropriate account of uncertainty. The sampling distribution describes how an estimator varies across repetitions of the stipulated sampling procedure. Design-based analysis derives this distribution from the selection mechanism; model-based analysis derives it from assumptions about data generation. Model-assisted survey methods retain design-based justification while using auxiliary-variable models to improve precision.

A confidence interval is constructed by a procedure with a specified repeated-sampling coverage probability. For a sufficiently regular estimator, a common approximate interval is

θ^±z1−α/2SE⁡^(θ^),\hat\theta \pm z_{1-\alpha/2}\widehat{\operatorname{SE}}(\hat\theta),

where z1−α/2z_{1-\alpha/2} is a quantile of the standard normal distribution. This approximation may be inadequate for very small samples, rare events, highly variable weights, or estimates dominated by a few observations. For simple random sampling without replacement, counts of units possessing an attribute follow a hypergeometric distribution, which can be used in exact finite-population calculations.

Complex designs require variance methods that reproduce their essential structure. Taylor linearization approximates a nonlinear estimate, such as a ratio, by a linear expression whose design variance is tractable. Replication methods repeatedly recompute estimates using sets of replicate weights. These include the jackknife, balanced repeated replication, and design-adapted forms of bootstrap sampling. Resampling individual observations as though they were independent can give incorrect results when the original sample was stratified or clustered.

For a proportion in a large population under simple random sampling, an approximate initial sample-size calculation is

n0=z1−α/2 2p(1−p)e2,n_0=\frac{z_{1-\alpha/2}^{\,2}p(1-p)}{e^2},

where ee is the desired absolute margin of error. At 95 percent confidence, p=0.5p=0.5, and e=0.03e=0.03, this gives about 1,068 completed observations. The choice p=0.5p=0.5 maximizes the variance among possible proportions and is therefore conservative for this calculation. For finite population size NN, a common correction is

n≈n01+(n0−1)/N.n\approx\frac{n_0}{1+(n_0-1)/N}.

Actual survey planning must also allow for design effects, anticipated nonresponse, subgroup reporting, and cost. A response target of 1,000 requires more than 1,000 initially selected units if not all selected units participate. Multiplying a simple-random-sampling requirement by an anticipated design effect is a useful approximation, although design effects themselves can vary across outcomes.

Inference for a population total, a regression coefficient, and a rare subgroup proportion can require quite different sample sizes. Requirements framed around statistical power additionally depend on an effect size and the proposed test. A single overall margin of error cannot describe the precision of every result produced by a survey.

Coverage, nonresponse, and other sources of error

Random sampling controls a specific source of uncertainty: variation caused by observing some units rather than the entire population. It does not eliminate errors in the frame, participation, questions, instruments, coding, or analysis. The total survey error framework distinguishes these sources so that a small sampling variance is not mistaken for overall accuracy.

Coverage error occurs when the frame and target population differ. A survey restricted to one communications channel, for example, may exclude people who do not use that channel. Duplicate records can give some units multiple opportunities for selection unless the design accounts for multiplicity. A complete enumeration of an incomplete frame still fails to cover the missing target units; increasing the sample from that same frame cannot resolve the problem.

Nonresponse arises when selected units provide no data or omit particular items. Its effect depends on how respondents and nonrespondents differ for the quantity of interest, not simply on the response rate. In a simplified decomposition, let rr be the responding fraction, and let YˉR\bar Y_R and YˉNR\bar Y_{NR} be respondent and nonrespondent means. Then

YˉR−Yˉ=(1−r)(YˉR−YˉNR).\bar Y_R-\bar Y = (1-r)(\bar Y_R-\bar Y_{NR}).

A high response rate can still accompany appreciable bias if the remaining nonrespondents differ substantially; a low response rate does not by itself identify the magnitude or direction of bias.

Measurement error includes inaccurate answers, interviewer effects, instrument limitations, question-order effects, and misclassification. Processing errors include faulty editing, record linkage, coding, and data transformation. Some errors behave partly like additional random noise, while others systematically shift estimates. The mean squared error decomposition,

MSE⁡(θ^)=Var⁡(θ^)+Bias⁡(θ^)2,\operatorname{MSE}(\hat\theta) = \operatorname{Var}(\hat\theta) + \operatorname{Bias}(\hat\theta)^2,

shows why reducing sampling variance alone may yield little improvement when bias dominates.

Convenience samples, volunteer panels, and open online polls generally lack known population inclusion probabilities. A very large number of responses can produce a highly stable description of participants without accurately describing the target population. This is a form of selection bias, not a defect that disappears automatically with sample size.

Weighting, follow-up, and imputation can address parts of these problems under stated assumptions. For example, response weighting assumes that the available adjustment variables adequately account for relevant response differences. If participation remains related to an unobserved outcome after adjustment, residual bias can remain. Consequently, a conventional sampling margin of error describes only part of uncertainty and cannot by itself certify the validity of an estimate.

Random-number generation and computational sampling

The mathematical design must be translated into an executable selection procedure. Historical methods used physical lotteries, shuffled cards, or printed random-number tables. Modern selection usually relies on a pseudorandom number generator, a deterministic algorithm whose output is designed to have useful statistical properties. Its initial state, often determined by a seed, makes a selection reproducible. Reproducibility is valuable for auditing, but does not establish that the generator, frame, or selection algorithm is suitable.

Uniformly selecting an integer from 0,…,m−10,\ldots,m-1 requires attention to the generator’s output range. Simply taking a random integer modulo mm creates bias unless the number of possible generator outputs is divisible by mm. A standard correction rejects outputs in an incomplete final block before applying the remainder operation. The resulting accepted outputs give each target integer the same number of preimages.

For simple random sampling without replacement, a Fisher–Yates shuffle places a finite list in uniformly random order when each successive swap position is selected uniformly. Taking the first nn records then yields a simple random sample. Partial shuffling can avoid fully permuting the list. If records arrive as a stream and the final size is unknown, reservoir sampling maintains a sample of fixed size kk: retain the first kk records, then at record t>kt>k, retain the new record with probability k/tk/t, replacing a uniformly selected retained record. After tt records, every record has inclusion probability k/tk/t.

Sampling from a specified continuous distribution often uses a uniform variate UU and the inverse cumulative-distribution method,

X=F−1(U),X=F^{-1}(U),

where the inverse is interpreted as a generalized inverse when necessary. Other methods include rejection sampling and transformations specialized to particular distributions. These procedures support the Monte Carlo method, in which random draws approximate expectations, probabilities, and integrals.

Not all computational draws are independent. Markov chain Monte Carlo constructs a dependent sequence intended to explore a target distribution. Its estimation uncertainty depends on convergence and serial dependence, so the number of stored draws is not automatically the number of effectively independent observations. Similarly, draws from a numerical distribution are not, by themselves, a probability sample of real-world people or organizations.

A documented sampling implementation records the frame version, eligibility rules, generator, seed or state, selection stages, and inclusion probabilities. Frame ordering also matters: repeating a systematic-sampling procedure with the same start but a differently sorted frame can select different units. Incorrect eligibility filters or post-selection substitutions can alter the design even when the random-number routine itself operates correctly.

Historical development and scientific applications

Sample-based reasoning predates modern survey theory. In the late eighteenth century and early nineteenth century, Pierre-Simon Laplace developed probabilistic approaches to inference and applied sample information to population estimation. Such early work did not yet establish the full modern distinction between a probability design and purposive selection, but it helped demonstrate how observations from part of a population could support numerical statements about the whole.

A major institutional debate began with Anders Nicolai Kiær’s presentation of the “representative method” to the International Statistical Institute in 1895. His approach challenged the view that official statistics necessarily required complete enumeration, although representative selection initially included purposive elements. Arthur Lyon Bowley subsequently advanced random selection and the mathematical treatment of sampling precision in social investigation.

Jerzy Neyman’s 1934 paper on representative sampling provided a decisive account of stratified random sampling and its advantages over purposive selection. It connected selection design, efficient allocation, and confidence-based inference. In the following decades, work by statisticians including William G. Cochran, Morris H. Hansen, William N. Hurwitz, and W. Edwards Deming helped make large-scale probability surveys technically and administratively practicable. The 1952 Horvitz–Thompson result supplied a general unbiased estimator for totals under unequal inclusion probabilities.

The 1936 United States presidential polling failure of the Literary Digest became an influential illustration of the limits of sample size. Its large response count did not compensate for weaknesses in the lists used to contact potential respondents and differences in participation. The episode is not adequately described as a small-sample accident: it concerned the relationship between the surveyed respondents and the electorate.

Today, probability sampling supports labor-force surveys, agricultural statistics, business surveys, environmental monitoring, and quality inspection. A population census seeks complete enumeration, but sampling can be used for supplementary questions and post-enumeration coverage studies. In environmental work, spatially distributed selections help estimate conditions across a region rather than only at easily accessible sites. In manufacturing, randomly selected products provide evidence about process quality without inspecting every item.

Random sampling must also be distinguished from random assignment. In a randomized controlled trial, assignment allocates recruited participants to treatments by chance, helping support causal inference within the study. Random sampling concerns how units enter the study and supports inference to a defined population. A trial can have randomized treatment allocation but nonrandom recruitment; a probability survey can represent a population without identifying causal effects. The two procedures address different inferential questions, and either may be present without the other.