Chapter 1 Introduction

The analysis of surveys with complex designs has a well-established tradition in the statistical literature, grounded in the design-based inference approach. As noted by Särndal et al. (2003) and Gutiérrez (2016), this approach recognizes the probability distribution induced by the sample selection process as the only probabilistic mechanism governing inference. Under this paradigm, the statistical properties of estimators, such as unbiasedness, precision, and consistency, are evaluated with respect to the distribution of all possible samples that the design can generate, without imposing distributional assumptions on the variable of interest.

Within this framework, variance estimation has played a central role and has evolved around three broad complementary methodological families. The first, the ultimate cluster method (Hansen et al., 1953), simplifies the multilevel structure by concentrating variability in the primary sampling units (PSUs), treating selection as if it were carried out with replacement. The second, Taylor linearization (Binder, 1983), extends this principle to nonlinear parameters, such as means, proportions, and ratios, through a first-order approximation that reduces the variance estimation problem to that of a total. Finally, the third family, replication methods such as jackknife, bootstrap, and balanced repeated replication, estimates variance from the dispersion among estimates obtained through systematic sample replicates.

In parallel, in the field of statistical modeling, foundational contributions such as those by Kish & Frankel (1974), Fuller (1975), and Binder (1983) laid the groundwork for weighted regression and variance estimation for coefficients under stratified and multistage designs. Building on this development, Pfeffermann (1993) formalized the maximum pseudo-likelihood (MPL) method, which incorporates sampling weights into the log-likelihood function to produce design-consistent estimators, thereby extending the generalized linear models of Nelder & Wedderburn (1972) to the context of surveys with complex designs.

More recently, Heeringa et al. (2017) have synthesized these contributions within a unified analytical framework that coherently integrates the sampling design, weighting, and modeling, establishing their work as a standard reference for contemporary practice in complex survey analysis.

This document is intended for readers with training in statistics or data science, or with equivalent professional experience. It is especially designed for those who have knowledge of the foundations of sampling theory, such as inclusion probabilities, estimators, and confidence intervals, of linear and logistic regression models, and of introductory programming in R.

In this context, the document is positioned as an intermediate-to-advanced text aimed at deepening and consolidating this knowledge, facilitating its rigorous application in complex and technically demanding settings. Its purpose is to accompany researchers in the transition from theoretical foundations to their proper implementation in the production of official statistics, academic research in the social sciences, public policy evaluation, and data analysis under international quality standards.

1.1 Rationale

Despite the methodological richness available in the specialized literature, a significant gap persists between the state of the art and the everyday practice of survey analysis in the region. One of the main manifestations of this gap is related to access to and use of statistical software. Several widely recognized reference texts in survey analysis, such as Heeringa et al. (2017), Cochran (1977), and Särndal et al. (2003), are fundamental from a theoretical perspective; however, they are mainly oriented toward licensed software such as SAS, Stata, or SPSS, or they do not fully integrate with the R computational ecosystem. In contrast, many online tutorials on survey analysis in R tend to privilege the operational aspects of the software, but rarely reach the conceptual depth needed for appropriate and responsible use in the production of official statistics.

In addition, there is substantial methodological fragmentation among the different components involved in complex survey analysis. The foundations of sampling design, computational data management, estimation of descriptive and inferential parameters with design correction, and treatment of nonresponse are often addressed separately, making it difficult to build integrated and reproducible workflows. In this context, the present text proposes a coherent integration of these elements within a single analytical framework implemented entirely in R.

Another relevant aspect is the regional contextualization of the examples and applications. A considerable share of reference texts use databases and examples from surveys conducted in English-speaking countries, which partially limits their immediate applicability in Latin America. To bring the content closer to the statistical realities of the region, this document uses a native R database designed to replicate the traditional structure of Latin American household surveys and therefore to provide examples closer to the problems faced by national statistical offices and technical teams in the region.

Finally, this document is itself an exercise in reproducible research. All of its content, including tables, figures, equations, and numerical results, is generated entirely through R code embedded directly in the chapters. In this way, readers can not only study the methods presented, but also replicate, modify, and adapt them to their own contexts and databases, thereby strengthening analytical capacity and transparency in statistical production.

1.2 Use of R Software for Survey Analysis

The choice of R as the computational environment for this document is not arbitrary. R has at least three characteristics that make it an ideal option for household survey analysis in the Latin American context.

First, it is freely accessible. Unlike other programs with licensing costs that may be prohibitive for many national statistical offices in developing countries, R is distributed under the GNU license, ensuring that the methods presented in this document are fully accessible and replicable regardless of institutional budget constraints.

Second, its specialized ecosystem stands out. The survey package (Lumley, 2024), available since 2004 and constantly evolving, implements a wide range of estimation methods for complex designs: Horvitz-Thompson estimators, calibration techniques, Taylor linearization, replication methods, weighted regression models, and design-adjusted hypothesis tests such as Rao-Scott tests, among others. In turn, the srvyr package (Freedman Ellis & Schneider, 2024) extends these capabilities by incorporating the syntax of the tidyverse ecosystem, facilitating a smooth transition between exploratory and inferential analysis. Complementary packages such as TeachingSampling (Gutiérrez, 2020) and convey (Jacob et al., 2024) consolidate an analytical environment that is difficult to match in other languages.

Finally, R offers strong integration with tools for scientific reproducibility. In particular, its combination with R Markdown and the bookdown system makes it possible to generate documents in which results, tables, and figures are produced directly from the source code. This capability is especially relevant in the field of official statistics, where traceability and methodological transparency are fundamental requirements.

1.3 Structure of the Document

This document is organized according to a logical progression that moves from the conceptual foundations of sampling to more advanced applications of statistical modeling and treatment of nonresponse. This sequence is not arbitrary: each level of knowledge is a necessary prerequisite for understanding the next, allowing the reader to move coherently from basic principles to more sophisticated analytical tools.

First, the foundations of sampling design are addressed. Proper survey analysis necessarily begins with understanding its probability design. Before estimating any parameter, the analyst must become familiar with three constitutive elements: the target population, understood as the set of units about which inferences are to be made; the sampling frame, which corresponds to the operational enumeration of those units; and the sampling units at each stage of the design. These components determine both the validity and the scope of subsequent inferences.

Next, the computational elements that make it possible to materialize these concepts in an applied environment are introduced. The document incorporates variable management and transformation through a programming environment suitable for incorporating the sampling design, which constitutes the central axis of the analytical workflow and ensures that all statistical operations respect that structure.

Once the design has been correctly specified, the document moves on to the estimation of descriptive parameters. This section covers the most commonly used estimators in survey analysis for continuous variables, such as income, expenditure, or assets, including totals, means, and ratios. It also presents their corresponding precision measures, including variances, standard errors, and confidence intervals, adjusted for the complexity of the sampling design.

The document then develops statistical modeling, extending the analysis beyond descriptive statistics toward an analytical and inferential approach. In particular, it addresses linear regression models under complex designs, where the explicit incorporation of sampling weights is fundamental for obtaining design-unbiased estimators. This context highlights the discussion between the design-based approach, which prioritizes statistical properties at the population level, and the model-based approach, which depends on correct functional specification. Consequently, the importance of assessing the sensitivity of results through comparisons between weighted and unweighted estimates is emphasized. In addition, generalized linear models and multilevel models are introduced, broadening the scope of analysis to nonnormal response variables, such as binary variables (logistic regression), counts (Poisson regression), and proportions.

The organization of the chapters follows the conceptual architecture described above, moving from foundations to more complex applications. Chapter 2 presents the basic concepts for household survey analysis, emphasizing that the validity of estimates depends on properly incorporating the sampling design. It explains the central elements of a survey, such as the target population, sampling frame, sampling units, stratification, clustering, and sampling weights. The chapter also introduces the main sampling estimators for totals, means, and other population parameters, and develops the foundations for estimating variance and confidence intervals.

Chapter 3 addresses the rigorous estimation of descriptive parameters for numerical variables under complex designs and develops techniques for estimating totals and means, together with variance estimation through the ultimate cluster method and the construction of confidence intervals with adjusted degrees of freedom. It also presents alternative approaches to variance estimation, such as Taylor linearization, estimating equations, and replication methods, including bootstrap and jackknife. The chapter also covers weighted quantile estimation, inequality analysis using indicators such as the Gini index and the Lorenz curve, estimation in domains and subpopulations, and visualization of results with confidence intervals.

Chapter 4 addresses the analysis of categorical variables under complex designs, including the assessment of associations between categories using methods that properly incorporate the sampling design. It develops techniques for estimating population counts and proportions from weights, together with estimation of their variability through linearization and construction of confidence intervals, including robust approaches for extreme proportions. It also presents weighted contingency tables with their corresponding frequencies and proportions, as well as independence tests that adjust the classical statistic to reflect the design effect. The chapter also covers the estimation and interpretation of association measures such as odds ratios, the analysis of differences in proportions between subpopulations through contrasts, and various visualization strategies, including bar charts with confidence intervals and maps.

Chapter 5 focuses on analyzing relationships between variables and building predictive or explanatory models that are valid under complex designs, when the classical assumptions of independence and identical distribution are not met. It presents the evolution of the problem from early contributions to more recent developments and discusses the implications of working with survey data in the context of regression models, including violations of the assumptions of the classical linear model. It contrasts the design-based approach with the model-based approach. The chapter also addresses hypothesis testing with appropriate adjustments, residual diagnostics, and identification of influential observations.

Chapter 6 extends statistical modeling to variables that do not follow a normal distribution, such as binary, multinomial, and strictly positive variables, in the context of complex sampling designs. To do so, it builds a unified framework based on generalized linear models, incorporating their fundamental components, and discusses inferential duality in finite populations, where the probability measure of the model and that of the sampling design coexist. It also contrasts the classical maximum likelihood approach with maximum pseudo-likelihood, based on weighted estimating equations that incorporate sampling weights, and studies variance estimation through linearization techniques.

Chapter 7 reviews multilevel models, also called hierarchical or mixed-effects models, for analyzing data with a nested structure by simultaneously incorporating individual-level and contextual variables. Through regression examples, with intercepts and slopes that vary by stratum, it shows that ignoring the hierarchical structure can lead to incorrect inferences, whereas modeling it explicitly makes it possible to capture heterogeneity between groups and borrow information across them. The approach is formalized with the null model, which decomposes variance into within-stratum and between-stratum components and allows computation of the intraclass correlation coefficient (ICC), a key indicator for quantifying within-group dependence.

In addition, the first appendix introduces data management in R using the tidyverse environment, with emphasis on the dplyr package. Using the BigCity database, it presents a basic workflow that includes loading libraries, initial inspection of the database, use of the chaining operator %>%, and application of the main dplyr verbs: filter(), select(), arrange(), mutate(), summarise(), and group_by(). The chapter shows how to select records and variables, sort data, create new variables, and produce descriptive summaries, explaining both the logic of the code and the interpretation of its output.

Finally, the second appendix addresses inference in finite populations and the difference between model-based inference and design-based inference. Through simulation examples, it shows that in complex surveys randomness mainly comes from sample selection and that, therefore, estimates must incorporate inclusion probabilities and sampling weights. It presents the maximum likelihood method as a starting point for statistical models under assumptions of independent observations and then presents maximum pseudo-likelihood as an appropriate extension for survey data, where each individual contribution is weighted according to the design.

Readers who go through the chapters in order will have built the capacity to take any Latin American household survey, understand its design, process its data, estimate indicators of interest with the correct statistical precision, model relationships between variables validly under the complex design, and handle nonresponse with appropriate methods. That capacity is, in essence, what rigorous production of social statistics requires.

References

Binder, D. A. (1983). On the variances of asymptotically normal estimators from complex surveys. International Statistical Review/Revue Internationale de Statistique, 279–292.
Cochran, W. G. (1977). Sampling techniques. John Wiley & Sons.
Freedman Ellis, G., & Schneider, B. (2024). Srvyr: ’Dplyr’-like syntax for summary statistics of survey data. https://doi.org/10.32614/CRAN.package.srvyr
Fuller, W. A. (1975). Regression analysis for sample survey. Sankhya, Series C, 37, 117–132.
Gutiérrez, H. A. (2016). Estrategias de muestreo: Diseño de encuestas y estimación de parámetros (Segunda edición). Ediciones de la U.
Gutiérrez, H. A. (2020). TeachingSampling: Selection of samples and parameter estimation in finite population. https://doi.org/10.32614/CRAN.package.TeachingSampling
Hansen, M. H., Hurwitz, W. N., Madow, W. G., et al. (1953). Sample survey methods and theory.
Heeringa, S. G., West, B. T., Heeringa, S. G., & Berglund, P. A. (2017). Applied survey data analysis. chapman; hall/CRC.
Jacob, G., Pessoa, D., & Damico, A. (2024). Convey: Income concentration analysis with complex survey samples. https://doi.org/10.32614/CRAN.package.convey
Kish, L., & Frankel, M. R. (1974). Inference from complex samples. Journal of the Royal Statistical Society, Series B, 36, 1–37.
Lumley, T. (2024). Survey: Analysis of complex survey samples.
Nelder, J. A., & Wedderburn, R. W. M. (1972). Generalized linear models. Journal of the Royal Statistical Society: Series A (General), 135(3), 370–384. https://doi.org/10.2307/2344614
Pfeffermann, D. (1993). The role of sampling weights when modeling survey data. International Statistical Review, 61(2), 317–337. https://doi.org/10.2307/1403631
Särndal, C.-E., Swensson, B., & Wretman, J. (2003). Model assisted survey sampling. Springer Science & Business Media.