Skip to main content

Pets, wellbeing, and the ecological fallacy

Curiosity · ENBIARE 2025

A relationship measured between groups can reverse for the individuals inside them. That mistake has a name, the ecological fallacy, and INEGI’s new pet data is an unusually clean example of it.
Author

Alain Pineda

Published

September 2, 2026

Modified

November 5, 2026

Curiosity · INEGI, ENBIARE 2025 · Public microdata

Statistics has an old mistake with a name. It shows up when a relationship is measured between groups and then read as if it also held for the individuals inside those groups. The two are different quantities. They can differ by a lot, and they can point in opposite directions.

The example that named the mistake is from 1950. Looking at the 1930 US census, the sociologist W. S. Robinson found that states with more foreign-born residents had less illiteracy, a correlation of −0.53 across states. Among individuals the relationship ran the other way: a foreign-born person was more likely to be illiterate, a correlation of +0.12. Both numbers are right. They answer different questions, and only the second one is about people. Robinson called the first an ecological correlation, and treating it as if it were the second became known as the ecological fallacy.

The trap is easy to describe and hard to see in the wild, because aggregated data never announces that it is aggregated. Mexico now has an unusually clean example, and it is about pets.

What INEGI published

In July 2026 INEGI released the microdata of its 2025 wellbeing survey. It counts pets for the second time, after the 2021 edition: 66.4% of homes have at least one, and the survey expands to 41.2 million dogs and 19.2 million cats. The headline travelled, and so did a ranking of states.

Where the pets are

Pets are not spread evenly. Hidalgo, Tlaxcala, Oaxaca and Puebla sit near 73% of homes. Mexico City closes the list at 56%.

States close in the ranking usually cannot be told apart

Each state is estimated from about a thousand homes. The median standard error is 1.7 points, so a 95% confidence interval runs 3.3 points either side of the estimate and is 6.6 points wide. The distance between Tlaxcala and Puebla is 0.47 of a point. It fits fourteen times inside that interval.

Share of homes with at least one pet, by state, with 95% confidence intervals from the survey design. The dashed line is the national estimate, 66.4%.

The survey can tell two states apart only if the gap between their estimates exceeds its own 95% margin of error. Because both estimates carry error, that margin is wider than the 3.3 points of a single state. Its median across the 496 pairs of states is about 4.6 points. Of those pairs, 239 differ by more than their own margin and 257 do not, before any allowance for making 496 comparisons at once. A stricter test that allows for them finds 84.

The 32 states span 17 points, about half a point per place in the ranking, so states close in the ranking differ by little. None of the 61 pairs within two places of each other differs by more than its margin. Of the 22 pairs ten places apart, 8 do. All 136 pairs sixteen or more places apart do. Reading the ranking position by position treats small gaps as results.

Most of the spread across states is not sampling error: about 14% of the variance among the 32 estimates is. The ranking is informative about groups of states and about the extremes, and uninformative position by position. Mexico City, last at 56%, is below 29 of the other 31 states by more than each pair’s margin. Quintana Roo and Tabasco are the two it cannot be told apart from. Under the stricter test it is below 22.

The same relationship at two levels of aggregation

The survey asks about eight household assets in the same section as the pets: refrigerator, washing machine, car, flat screen, computer, game console, internet, and a paid streaming service. Counting them gives a rough index of material standard of living, from 0 to 8. Crossing that index with pet ownership gives two answers, depending on what counts as an observation.

Left: the 32 states, average assets against the share of homes with a pet. The correlation is −0.39. Right: homes grouped by how many of the eight assets they own. Both panels share the vertical axis.

Between states the relationship is negative. Within the country it is positive and close to monotone, rising 21.9 points from homes with no assets to homes with all eight. Both panels describe the same 32,908 homes.

That is Robinson’s reversal, with pets in place of literacy. The left panel is a fact about states and it is correctly measured. It is simply not a fact about households, and nothing in it warns that the household version runs the other way.

What produces the reversal

Composition. The states with the most pets are the most rural, and rural pulls in both directions at once: lower assets and more dogs. In localities under 10,000 inhabitants, 71.4% of homes have a pet, against 64.0% elsewhere, and there are 1.28 dogs per home against 0.95.

Once state fixed effects, locality size and household size are held constant, each additional asset is associated with a 2.8 point higher probability of having a pet (standard error 0.19) and 2.7 points for a dog (0.20). For cats the coefficient is 0.17 points (0.17), which is indistinguishable from zero. These are conditional correlations from a cross-section, not effects.

Where else this shows up

The same trap is available wherever data arrive already grouped. A comparison of countries read as a statement about people. A state map of poverty next to a state map of anything else. Any regression whose unit is a region when the claim is about individuals. The question that catches it is short: what is one row of this table? If the answer is a state and the claim is about households, the two do not have to agree.

Robinson, W. S. (1950). Ecological Correlations and the Behavior of Individuals. American Sociological Review 15(3), 351–357.

How this is built

Source: INEGI, Encuesta Nacional de Bienestar Autorreportado 2025, open microdata, housing table. Pets are questions P1.8.1.1 through P1.8.3.2, six items inside the housing section. The survey covers 32,908 homes and expands to 38.9 million, with estimates representative nationally and by state.

All estimates use the survey’s declared design (primary sampling units, strata and expansion factors) through R’s survey package, the same standard the Labor Market MX pages apply to the ENOE. The national figures reproduce INEGI’s own release exactly. The script that downloads the microdata, computes every number on this page and draws both figures is scripts/08-curiosities-pets.R in this site’s public repository.

The comparisons in the section on the ranking treat the 32 estimates as independent and each standard error as exact. The 95% margin of error for a pair of states is 1.96 times the square root of the sum of their two squared standard errors, and the 4.6 points quoted is the median of the 496 margins. The share of variance due to sampling error is the average of the 32 squared standard errors divided by the variance of the 32 estimates. The standard errors measure sampling error only. The margins are not adjusted for the number of comparisons. The stricter test is Holm’s correction, applied to two-sided normal p-values for the 496 pairs. It keeps the chance of declaring at least one difference that does not exist at 5% or less. With it, 84 pairs are declared different, and Mexico City is below 22 of the other 31 states.

The survey records whether the home has a dog, a cat, or another pet, and how many of each. It does not record what the other pet is, nor spending, veterinary care, sterilisation, or breed, and it does not go below the state and locality-size level.