Skip to main content

Working draft

Survey Sampling Design with R

A guide to planning and selecting probability samples in R. It follows one workflow across three layers. svyplan sizes and allocates the sample, samplyr declares the design and selects the units, and survey or srvyr estimates from the collected data.

  • Written in Quarto and free to read online
  • Examples run on rebuilt frames and synthetic populations
  • Design tested before fieldwork with virtual surveys and stress tests
  • Working draft, written in English

Six parts, from foundations to complete examples

Part I

Foundations

From the question to the sample, a short introduction to R, a tour of svyplan and samplyr, the principles of probability sampling, area frames, and virtual surveys, which simulate a design on a synthetic population.

Part II

Planning a household survey

Domains defined from past survey reports, precision targets and sample size, the trade-off between clusters, take size, and cost, and allocation across strata and domains.

Part III

Drawing the sample

Selection of primary sampling units, listing and selection of households, weights, sampling errors, transfer to analysis, and the sample design report.

Part IV

Stress tests before fieldwork

Operational risks to diagnose and reduce before the teams leave (old frames, excluded areas and undercoverage, nonresponse and reserve households, EA size and budget).

Part V

Beyond one cross-section

Fieldwork spread over the year (subrounds), rotating panels and master samples, coordination by permanent random numbers (PRN), two-phase designs, special populations and multiple frames, and power for evaluation.

Part VI

Complete examples

Four design examples worked end to end on synthetic data, plus a template for adapting the workflow to your own survey.

Four examples on synthetic data

Part VI applies the workflow of the book to four examples. Each one starts from a real national survey and supposes that the statistical office plans its next round. None is the official design of a survey, and none was prepared with or for the offices and programs named below.

The only information taken from the real surveys is what their reports publish, such as sampling errors, design effects and response rates. The book uses no microdata. The sampling frames are built for the book, and the boundaries of their enumeration areas (EAs) are modeled, not official. Household listings and populations are synthetic.

A virtual survey is a simulation. It draws the design hundreds of times on a synthetic population whose true values are known, and measures the precision that design would deliver. No one goes to the field and no household is interviewed. The results describe the sample design, not the countries.

Example Published inputs Frame and population What the chapter works through
A DHS for The Gambia Final reports of the 2013 and 2019-20 DHS. EAs modeled with decoupage on the 2024 EA codes. Synthetic population calibrated to the 2019-20 report. Stratified two-stage design with systematic PPS, 25 households per cluster, a men’s subsample in half of the households, weights, and a virtual survey.
A MICS for Zimbabwe 2019 MICS Survey Findings Report. WorldPop pre-EAs with household counts calibrated to the ward totals of the 2022 census. They are not the census EAs. Synthetic listing and segment counts. Target stated as a relative margin of error, one design effect for every province, fit to a budget, segmentation of large clusters, a drinking water subsample, and a backtest against the 2019 report.
A labor force survey for Rwanda Labour Force Survey Annual Report 2024 and LFS Methodology (2024). EAs modeled within the 2022 census villages, with estimated household counts. Synthetic listing. Yearly CV by district, 2-2-2 rotation, master sample, a quarter spread over its three months, and a backtest against the published results.
An integrated household survey for Malawi IHS4 poverty rates and their errors, as published in the IHS5 Basic Information Document. EA codes and household counts of the 2018 census, with modeled boundaries. Synthetic listing and population. 12 monthly subrounds, a certainty EA, replacement of nonresponding households, a separate sample for Dzaleka refugee camp, and a virtual survey.