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.

References

Freedman Ellis, G., & Schneider, B. (2024). Srvyr: ’Dplyr’-like syntax for summary statistics of survey data. https://doi.org/10.32614/CRAN.package.srvyr
Gutiérrez, H. A. (2020). TeachingSampling: Selection of samples and parameter estimation in finite population. https://doi.org/10.32614/CRAN.package.TeachingSampling
Jacob, G., Pessoa, D., & Damico, A. (2024). Convey: Income concentration analysis with complex survey samples. https://doi.org/10.32614/CRAN.package.convey
Lumley, T. (2024). Survey: Analysis of complex survey samples.