execute() returns a tbl_sample: the selected rows of the frame plus a
set of generated columns recording how each row was selected. k is the
stage index, so a two-stage design carries .weight_1 and .weight_2.
The literal names .weight_k and .fpc_k are not themselves reserved.
Details
The generated columns are:
.sample_id: Sequential identifier for each output row. Under WR or PMR, separate occurrences of one population unit have different values..weight: Sampling weight. This is inverse inclusion probability for WOR and inverse expected hits per output row for WR or PMR..weight_1,.weight_2, ...: Per-stage sampling weights (\(1/q_i^{(k)}\)), where \(q\) is an inclusion probability for WOR or an expected hit count for WR or PMR. In a single-phase multi-stage sample their product equals.weight. In a multi-phase sample.weightadditionally includes earlier-phase weights..fpc_1,.fpc_2, ...: Per-stage finite population correction values. The meaning depends on the method and context:Equal-probability WOR (srswor, systematic): \(N_h\) (stratum population size), or \(N\) if unstratified. The sampling fraction \(f = n / N\) is derived from this at variance_estimation time.
PPS WOR (pps_brewer, pps_cps, etc.): \(N_h\) (stratum population size), converted to \(\pi_i = 1/w_i\) at survey export, because
survey::svydesign()expects inclusion probabilities for unequal-probability stages.Clustered stages: the number of clusters in the stratum/group, not the number of ultimate units.
WR / PMR (srswr, pps_multinomial, pps_chromy): \(\infty\). These exports use no finite population correction and the Hansen-Hurwitz variance treatment. It is approximate for PMR.
In a multi-stage design, each stage has its own
.fpc_k. At survey export (as_svydesign()), these are assembled into a multi-level FPC formula (e.g.,~ .fpc_1 + .fpc_2)..draw_1,.draw_2, ...: Occurrence index per stage (WR/PMR methods only). For WR it identifies an independent draw. For PMR it indexes the realized occurrences, which need not be independent..certainty_1,.certainty_2, ...: Whether the unit's resolved inclusion probability is one, so that it is self-representing and contributes no variance at that stage. TRUE whether the probability came from acertainty_size/certainty_proprule or was capped at one by the probability calculation. Present for unequal-probability and balanced stages. Always FALSE for WR/PMR stages, where the recorded chance is an expected hit rather than a probability..zone_1: The zone a PSU was drawn from, when stage 1 fields a certainty plan solved withsvyplan::n_alloc(n_psu_per_zone = ). Zones are numbered within each stratum, one or two PSUs are drawn from each, and certainty PSUs haveNA. With two per zone the survey export uses stratum by zone as the variance strata..pair_1: The variance group of the PSU's zone, when the plan draws one PSU per zone. svyplan fixes the groups before selection, two or three zones each, numbered across strata, and certainty PSUs haveNA. The survey export uses the groups as the variance strata..replicate: Replicate identifier (only whenrepsis specified).panel: Panel assignment (only whenpanelsis specified), described in panel_assignmentStage and stratum identifiers as appropriate
How the weights are computed
Let \(q_i^{(k)}\) be the resolved selection quantity at stage \(k\): the first-order inclusion probability \(\pi_i^{(k)}\) for a method without replacement, the expected hit count \(E(K_i^{(k)})\) for WR and PMR methods. The stage weight is \(w_i^{(k)} = 1 / q_i^{(k)}\):
SRS: \(w_i = N / n\), constant for all units.
Stratified SRS: \(w_i = N_h / n_h\) within stratum \(h\).
PPS WOR: \(w_i = 1 / \pi_i\), with \(\pi_i\) from the measure of size by
sondage::inclusion_prob().WR / PMR: \(w_i = 1 / E(n_i)\) with \(E(n_i) = n \cdot p_i\). A unit selected \(k\) times appears \(k\) times, each with the same weight.
For every built-in method except "pps_sps" and "pps_pareto", the
resolved quantity is the design's true first-order inclusion probability
or expected hit count. Those two, and registered methods declared
probabilities = "approximate", honor it only to a documented
approximation, so .weight is the inverse of a target probability. That
is standard practice for these methods and the deviation is typically
small, but it is a bias of the method. The tier is recorded per stage in
the frame digest, reported by frame_summary() as the probabilities
column, and flagged by summary().
Across \(K\) stages the weight is the product of the stage weights, each resolved within the clusters selected at earlier stages: $$w_i = \prod_{k=1}^{K} \frac{1}{q_i^{(k \mid S^{(k-1)})}}$$ For an all-WOR design this is the inverse of the overall inclusion probability. A WR or PMR stage contributes an occurrence-level factor. For example, 5 of 30 EAs in a region and then 12 of 50 households in each selected EA give \((30/5) \times (50/12) = 25\).
A new phase executed on an earlier phase's sample multiplies the phase-1 weight by the conditional phase-2 weight, \(w_i = w_i^{(1)} \times w_i^{(2 \mid 1)}\), which gives the Horvitz-Thompson estimator for WOR phases.
See also
execute() which produces them, frame_summary() for the
population structure behind them, as_svydesign() for how they are
translated for survey
Other diagnostics:
compare_designs(),
design_effect,
frame_summary(),
joint_expectation(),
summary.tbl_sample(),
varcomp.tbl_sample()