ESTÚDIO 68

PTENES

How do you estimate who switched votes in the runoff without seeing a single vote?

By Maria Alice Maia · · video, 39 min · Read in Portuguese

Short answer

With ecological inference. The lesson uses the totals from almost 500 thousand polling places in both rounds. Shapley decomposition splits a candidate's gain among turnout, blank and null votes, and other candidates. The Goodman transfer matrix estimates, for each first-round group, where it went in the second round.

Key takeaways

For decision-makers

When receiving an analysis based on aggregate data, decision makers should ask whether the number speaks about the group or the person, what the effect size is, and where the quality score is, such as R squared.

What is ecological inference?

Ecological inference is the problem of understanding how profiles of people behave when only the total for each group is known. In an election, the voting machine reports turnout, votes per candidate, blank votes and null votes for each polling place, but nothing about each voter.

The video shows that companies face the same challenge. A retail chain sees that a store's performance changed between quarters without knowing which customers changed. An HR team sees a division plunge in an anonymous survey without knowing which employee profiles changed.

The lesson uses the election as a dataset to demonstrate statistical methods. The channel declares itself neutral and treats the numbers as one round of analysis, not as a final conclusion.

Why doesn't correlation between places prove how people behaved?

The common trap is to conclude that if a candidate grew more where more people returned to vote, those people voted for him. Maybe yes, maybe no. The method decides.

The classic example cited is neighborhoods with more drownings and more ice cream shops. Ice cream shops do not cause drowning. Heat and proximity to the beach explain both. This error of carrying a group-level conclusion over to the individual is the ecological fallacy.

The video also notes that maps show the net balance of each place. If 50 people return to vote and 10 stop voting, the balance is 40, not the path of each individual.

How does Shapley decomposition work?

The decomposition answers where a candidate's gain came from. In the lesson's example, a city with 100 thousand eligible voters has candidate A at 35 out of every 100 eligible voters in the first round and 50 in the second, a gain of 15 points.

The method asks how much the candidate would change if only turnout had changed, then only valid votes, and so on. Because the result depends on the order, Shapley averages the contribution of each source across all possible orderings, like splitting a bar tab.

The three parts add up to exactly 15 points, with nothing left over or missing. That is why the decomposition is not tested for significance. It divides a bill that has already happened.

In São Paulo, most of the gain came from voters of other candidates. The lesson notes that part of this shift is arithmetic, because valid votes must be split between the two finalists once the others drop out.

What does the Goodman transfer matrix show?

The matrix answers a different question: from each first-round group, where did people go. The algorithm plots, for every precinct in a city, first-round abstention against the candidate's second-round vote. The slope of the resulting line is the transfer rate.

The comparison is made only between precincts in the same city, to cancel out what is common to the municipality, such as the local economy or transportation. Only what varied from precinct to precinct remains.

The national result indicates that direct switching between voters of the two finalists was practically zero. Among those who abstained in the first round, 10% to 13% went to Lula and between 82% and 89% kept abstaining. Abstention generated the largest volume of votes because it was the largest group outside the finalists, despite having the lowest rate.

How do you know which number to trust?

The lesson uses within-municipality R squared as a quality score. For the finalists it was around 90%, for abstention around 75%, and for blank and null votes it dropped to 25%, a range where the model guesses more than it gets right.

Three questions close out the method. Is the number about the group or about the person? What is the effect size in reais, customers or percentage points, beyond significance? Where does the method fail?

In the analysis by territory profile, the groups that moved most toward Lula were those with higher income, literacy and GDP per capita, with fewer families on Bolsa Família and a higher density of evangelical churches. The video treats this as association, not causation.

Key concepts

Ecological inference
Estimating the behavior of profiles of people using only the totals for each group, without individual data.
Ecological fallacy
The error of attributing to individuals a relationship observed only between groups or places.
Shapley decomposition
Splitting a total change among sources that changed at the same time, by averaging contributions across all possible orderings.
Goodman transfer matrix
An estimate of how much of each initial group moved to each final group, using the slope of a line across comparable units.
R squared
A measure of how well the estimated line fits the data. It indicates which parts of the estimate are reliable.

FAQ

Does Shapley decomposition need a significance test?

No. According to the lesson, Shapley is not a statistical method that computes significance. It splits a change that has already been observed, and the parts add up exactly to the total. The uncertainty lies in the variable being decomposed, not in the split itself.

Why did abstention bring in so many votes if the rate of change was low?

Because abstention was the largest group outside the two finalists. A small rate applied to a large group produces a large number of people. That is why the lesson insists on looking at effect size, not just the rate or the significance.

Do these methods work outside politics?

Yes. The video applies the same reasoning to retail stores, when only total sales per location are known, and to anonymous HR surveys, when only the result per division is known. In every case the goal is to estimate which profiles changed without individual data.

Why compare only precincts in the same city?

Because factors common to the municipality, such as the economy, the strength of local parties and transportation, affect all precincts the same way. By comparing precincts in the same city, these factors cancel out and only the variation between precincts remains, which is what the method uses to estimate the transfer.

Translated text based on the transcript of the video, which is in Portuguese. The full reasoning and caveats are in the video.

Get new content in English

One email when a new guide, analysis or course comes out.