svy on Mexico’s ENIGH 2024

Validation
Community
Mexico
A community-led validation of svy against R’s srvyr on Mexican national income and expenditure microdata, covering weighted estimation, standard errors, and domain analysis by federal entity.
Author
Affiliation

Claudio Daniel Pacheco-Castro

Independent consultant — data analysis

Published

February 15, 2026

Modified

May 11, 2026

Keywords

svy validation, ENIGH, INEGI, srvyr, design-based estimation, Python survey analysis, microdatos, household survey, Mexican household survey, complex survey analysis Python

Summary

TipTL;DR

In early 2026, Claudio Daniel Pacheco-Castro published an independent comparison of svy against R’s srvyr package using microdata from Mexico’s ENIGH 2024 — the national income and expenditure survey conducted by INEGI. The Python and R implementations produce numerically equivalent results.

The walkthrough covers a complete ENIGH analytical workflow:

  • Survey design declaration with ENIGH’s stratification, primary sampling units, and final weights.
  • Weighted point estimation and standard errors for substantive indicators including the housing-deprivation measure (rezago habitacional).
  • Disaggregation by federal entity, demonstrating domain estimation across Mexico’s 32 states.

Read the original post (Spanish)

Background

The Encuesta Nacional de Ingresos y Gastos de los Hogares (ENIGH) is Mexico’s national income and expenditure survey, conducted by INEGI. It uses a complex stratified multi-stage probability design and is the primary microdata source for measuring poverty, inequality, and household consumption in Mexico.

What the analysis covers

The replication walks through a full ENIGH analytical workflow in Python and contrasts it with the equivalent srvyr code in R. It covers:

  • Survey design declaration with ENIGH’s stratification, primary sampling units, and final weights.
  • Weighted point estimation and standard errors for indicators including the housing-deprivation indicator (rezago habitacional).
  • Disaggregation by federal entity, demonstrating domain estimation across Mexico’s 32 states.

The Python and R implementations produce numerically equivalent results across the indicators tested.

Why this matters

ENIGH is widely used by Mexican researchers, INEGI, CONEVAL, and consultancies for poverty and inequality analysis. A reproducible Python pathway that matches the established R workflow lowers the barrier for analysts who work primarily in Python to engage with ENIGH microdata without changing their existing tooling.

Read the full post

De R a Python: trabajar con microdatos de encuestas complejas — Claudio Pacheco


TipCommunity signal

Help make svy the standard for survey analysis in Python

If rigorous, design-based survey inference in Python matters to you, starring the repository helps signal demand and prioritize validation and stability work.

Star svy on GitHub

Back to top