Stage II · Bachelor's: Methods
Part 18 of 65Who Did You Ask? Sampling and Surveys
How can 1,000 people speak for a nation, and how can 2.4 million fail to?
In 1936 the Literary Digest counts 2.4 million ballots, gives Landon 57%, and Roosevelt wins in a landslide. The World reruns it: an election in which Blue has 38.2% of 741,311 adults, a mailing to the telephone-and-car registers, and 34,588 returns that put Blue at 58.0%, while a random sample of 1,000 says 38.0%. The part separates the frame's bias from nonresponse, then derives Meng's identity, in which the error of any sample is a correlation times a size factor times a spread; by it the returns are worth 6 random voters. Neyman's design-based inference follows: the population is fixed and only the selection is random. Simple random sampling with its finite-population correction, stratification with Neyman allocation, clusters with Kish's design effect, and the Horvitz-Thompson, ratio and regression estimators are each checked on the island. The part ends with weighting and raking, which pull the Digest back to 49.1% and no further, and with the polls of 1948, 2016 and 2020.
What you need. Stage I of this series: expectation, variance and covariance, and the confidence intervals of Part 8.
- Hook
- the Literary Digest, 1936
- Mathematics
- SRS and the FPC, stratification, clusters, PPS, Horvitz–Thompson, raking, Meng's identity
- Built
- the World's polling firm
What you will be able to do
Bachelor's
- Explain why a random sample of 1,000 beats a self-selected sample of millions, naming frame bias and nonresponse bias.
- Compute the standard error of a simple random sample's mean with the finite-population correction, and the sample size a margin of error needs.
Master's
- Derive Meng's identity and the effective sample size of a biased sample.
- Derive Neyman allocation, and compute Kish's design effect for a cluster sample.
PhD
- Prove that the Horvitz-Thompson estimator is unbiased under any design with positive inclusion probabilities, and use Basu's elephants to say what unbiasedness does not buy.
Practice
- Weight a sample by post-stratification or raking, report Kish's effective sample size, and say which kind of nonresponse the weights cannot repair.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Bachelor's 23 min · Master's 47 min · PhD 52 min · Practice 32 min.
- 0The Literary Digest, 1936Bachelor's3 min
- 1What went wrongBachelor's4 min
- 2Meng's identityMaster's5 min
- 3Design-based inferenceBachelor's5 min
- 4Simple random samplingBachelor's4 min
- 5StratificationBachelor's4 min
- 6Clusters and stagesMaster's5 min
- 7Horvitz-ThompsonPhD4 min
- 8Ratio and regression estimatorsMaster's5 min
- 9WeightingPractice4 min
- 10PollsPractice6 min
- Recap, problems, and the road aheadAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
The Literary Digest, 1936Bachelor's3 min
In the autumn of 1936 the Literary Digest, an American weekly magazine, ran the largest opinion poll ever taken. It mailed ten million mock ballots to people on lists of telephone subscribers and car owners, and to its own readers, and about two point four million came back. They favoured the Republican challenger, Alf Landon, over President Franklin Roosevelt, by fifty-seven percent to forty-three. Under a simple-random-sampling formula, two point four million responses would imply a tiny margin of error. And the Digest had correctly called every presidential election since 1916.
Here is the Digest's forecast, with Landon, the challenger, in blue. And here's the election. Roosevelt won about sixty-one percent of the vote, and forty-six of the forty-eight states: one of the largest landslides in American history. The Digest was wrong by about twenty points. A young pollster called George Gallup, with a sample of about fifty thousand chosen by quotas to mirror the electorate, predicted Roosevelt's victory, and even predicted, in advance, the Digest's mistake. Within two years the Digest was gone.
We can rerun 1936 on the World. Its seven hundred and forty-one thousand adults live in two hundred towns on an island, here sized by population and coloured by region. They're voting in an election between a challenger, Blue, and the incumbent, Red. Because the World is ours, we know every vote: Blue has thirty-eight point two percent. And the World now has a polling firm that can run any survey we design, honest or not.
The World's Digest works the same way. Start from all the adults. Mail a ballot to everyone on the island's telephone and car registers: two hundred and eight thousand people, the better-off ones. About one in six sends it back: thirty-four and a half thousand ballots. Among all adults, Blue has thirty-eight percent. Among the listed, forty-seven. Among those who returned a ballot, fifty-eight: a confident Blue victory, and wrong by twenty points. Meanwhile a simple random sample of just a thousand adults says thirty-eight percent, with an interval of thirty-five to forty-one, which contains the truth.
Thirty-four thousand ballots, wrong by twenty points. A thousand random people, right to within three. How can so few speak for so many, and why can't the many speak for themselves? The answers are about how the sample was chosen, not how big it is.
Numbers: truth 38.2%; listed 46.8%; returns 58.0% (34,588); SRS 38.0% [35.0, 41.0]
1What went wrongBachelor's4 min
The Digest made two separate mistakes. The first was its list. In 1936 a telephone or a car was a sign of money. On the World's registers, the share of adults listed rises steeply with income: seven percent of the poorest band, two thirds of the richest. And support for Blue rises with income too. So the listed are richer: a median income of fifty-six thousand against thirty-nine. Among them Blue has forty-six point eight percent, eight point six points above the truth. That's frame bias, or coverage bias: the list from which the sample is drawn isn't the population.
The second mistake was who answered. Only one in six of the listed sent a ballot back, and the rate rises with income. More importantly, it depends on the vote itself: twenty-one percent of Blue voters returned their ballots, thirteen percent of Red voters. People eager for change, angry with the government, were keener to have their say. Among the returns, Blue has fifty-eight percent: another eleven point two points of bias, this time from nonresponse.
Put together: the World's truth, thirty-eight percent; the listed, forty-seven; the returns, fifty-eight. The error splits exactly into a coverage term, and a nonresponse term. And here's the crux: sending more ballots to the same list, or collecting more returns under the same response mechanism, does not in general remove either source of systematic bias. The Digest's two point four million ballots weren't a large random sample. They were a large, very particular one.
Was it really both? In 1988 Peverill Squire found a Gallup survey from May 1937 that had asked people whether they'd received a Digest ballot, and whether they'd sent it back. Both the list and the response had leaned toward Landon. But even among those who received a ballot, Roosevelt had a majority. So had everyone who was mailed a ballot replied, the Digest would at least have picked the winner. Nonresponse turned a poor sample into a disaster. The World tells the same story: its listed adults are forty-seven percent Blue, still a Red majority, and it's the returns that flip it.
There's a coda that shows the Digest's error was systematic, not bad luck. In July 1936, before the Digest had mailed a single ballot, George Gallup published a prediction of what it would find. He'd mailed three thousand postcards to people drawn from the same kinds of lists. He forecast that the Digest would show Landon with fifty-six percent; it printed fifty-seven. The World's version: three thousand names from the registers bring four hundred and eighty-nine replies, fifty-nine percent Blue, the Digest's answer in miniature. A bias, once understood, can be reproduced with a tiny sample. Making the sample bigger only makes it more precisely wrong.
Survey researchers call this the total survey error. Sampling error is the part our intervals measure, and the only part that shrinks with sample size. Coverage error comes from a frame that misses part of the population: telephones in 1936, landlines in the 2000s, the internet today. Nonresponse error arises when who answers depends on the answer. And measurement error comes from the questions themselves, their wording and order, and the interviewer; that's for Part 41. An interval of plus or minus three points speaks only for the first line.
Numbers: frame bias +8.6, nonresponse +11.2; return rates 20.6% Blue, 13.1% Red; median income 39k vs 56k listed; Gallup-style 3,000 → 489 replies, 59.3% Blue
2Meng's identityMaster's5 min
Xiao-Li Meng found a way to see both of the Digest's errors in a single line, and it's exact. For each of the N people in the population, let R be one if they're in our data and zero if not, so the average of R is the fraction f we observe. The sample mean is the average of R times y, divided by f. Subtract the population mean, and the error is the covariance of R and y over the whole population, divided by f. A covariance is a correlation times two standard deviations, and an indicator's standard deviation is the square root of f times one minus f. So the error of any sample, random or not, is the correlation between being in the data and the value, times the square root of one minus f over f, times the population standard deviation. No approximation, and no model.
Meng named the three factors. The correlation between being included and the answer is data quality: the data defect correlation. The square root of one minus f over f is data quantity: it shrinks only as the data approach the whole population. And the standard deviation is problem difficulty: how much the answers vary. Random sampling is what makes the first factor tiny: when a lottery decides who is included, R is unrelated to y, and rho is of order one over the square root of the population size. When people select themselves, rho can stay fixed however big the population is, and the error doesn't go away.
Apply it to the World's Digest. Its returns are four point seven percent of the adults. The correlation between returning a ballot and voting Blue, across all seven hundred thousand adults, is point oh nine: weak, the kind of correlation nobody would notice. The quantity factor is four point five two, and the standard deviation of a yes-or-no vote with thirty-eight percent yes is point four eight six. Multiply: point one nine eight. Exactly the nineteen point eight points the Digest was wrong by. A correlation of point oh nine, invisible in any single person, is a disaster in a population.
How many randomly chosen people would be as accurate? Set the biased sample's squared error equal to an SRS's variance, approximately sigma squared over m when its sampling fraction is small, and solve: the effective sample size is f over one minus f, divided by rho squared. For the World's Digest, thirty-four thousand five hundred ballots have the accuracy of a simple random sample of six people. Six. Even if half the island answered, three hundred and sixty-four thousand people, with self-selection producing a correlation of point one four, the result would be worth a random sample of fifty. Meng computed the same thing for the 2016 American election: the estimated defect correlation of minus point oh oh five implies that a hypothetical self-report sample of one percent of eligible voters, about two point three million, would have the accuracy of roughly four hundred random voters.
Here's the difference as a picture, for a population the size of the World. The error of a simple random sample falls like one over root n, to under a point by ten thousand. A self-selected sample with a data defect correlation of just point oh oh five is about four times worse at every size, because the ratio of the two errors is rho times the square root of N. With point oh two, it's seventeen times worse: eight points at ten thousand, and above a point until half the island is included. For a fixed data defect correlation, error falls with the sampling fraction. Reducing the correlation can also reduce the error. And because its confidence interval shrinks like any other, we become more confident of a wrong answer as the data grow: Meng's big-data paradox.
The Coverage Board. A simple random sample of a thousand adults, with the ordinary interval for a proportion: ninety-four point six percent coverage, kept. A self-selected half of the island, three hundred and sixty-four thousand people, with the same formula: zero coverage in two hundred repetitions. Its interval is a third of a point wide, and seven points from the truth. Size bought precision; it couldn't buy accuracy.
Numbers: ρ = 0.0902, f = 0.0467, √((1−f)/f) = 4.52, σ = 0.486 → 0.1980; n_eff 6 and 50; Board 94.6%, 0%
3Design-based inferenceBachelor's5 min
Sampling a population, rather than counting it, was once controversial. In 1895 Anders Kiær, director of Norway's statistics office, proposed his representative method to the International Statistical Institute: a partial count could stand for a full census, if the parts were chosen to resemble the whole. Many delegates thought anything short of a complete count unscientific. In 1912 Arthur Bowley surveyed working-class households in Reading, taking one house in twenty from the street lists, a selection free of the surveyor's judgment, and attached to his estimates a margin of error from the theory of chance. In 1934 Jerzy Neyman, in London, settled the argument with a paper on the two ways of choosing a representative sample: random selection, or deliberately picking units to match the population.
Neyman's main exhibit was a careful purposive sample. Corrado Gini and Luigi Galvani had summarized the 1921 Italian census by keeping the returns of a sample of districts, twenty-nine of two hundred and fourteen, chosen so that their averages matched the country's on several control variables. The controls matched. But on other characteristics, the sample was far off. Neyman's point was that with purposive selection there's no theory of the error: nothing tells you how far off you might be on the things you didn't control. Random selection gives both an estimate and a measure of its error, and that's why it won.
The logic of design-based inference is worth stating carefully, because it differs from everything since Part 8. The population's values are fixed numbers: the World's votes are what they are. Nothing about them is random. What's random is the sample, chosen by a lottery the statistician designs, with known probabilities for every possible sample. An estimator's expectation and variance are averages over the samples the lottery might have produced. So expectations and variances need no model for the data: the probability comes from the lottery itself. Approximate normal confidence intervals still need a suitable finite-population central limit theorem, just as in Part 13 the probability came from randomizing treatments.
There's a subtlety about what is being estimated. A survey targets a finite population: these seven hundred and forty-one thousand adults, about whom a complete, accurately measured census would settle the finite-population descriptive quantities. Most of this course has targeted something else: a superpopulation, the process that could have produced many populations, like the laws from which the World itself was drawn. What share of these people will vote Blue is a question about the finite population, and design-based inference answers it with no model. How income is associated with voting in the underlying process needs a model. A causal effect needs additional identification assumptions, which is what Parts 22 to 24 take up. Being clear about which question you're asking decides which uncertainty you should report.
Picture it on the island. Every adult has a ticket. Draw a thousand at random: here are the towns they live in, roughly in proportion to the towns' sizes. Draw again and you get different people and a different estimate. The spread of those estimates over all the samples the lottery could produce is the uncertainty we report. It's a property of the procedure, which we control, not of the population, which we can't see.
It helps to set the two views side by side. In design-based inference the randomness is in who is sampled; in model-based inference, in the values themselves. The first needs known selection probabilities; the second, a model for y. The first holds for any population; the second, only if the model is right. And each has its failure: design-based inference breaks when people select themselves, as in the Digest, because the selection probabilities are no longer known; model-based inference breaks when the model is wrong. Modern survey practice blends them, as Parts 25 and 41 will show.
Numbers: 29 of 214 districts (Gini & Galvani)
4Simple random samplingBachelor's4 min
In a simple random sample of n from N without replacement, every set of n people is equally likely. Write the sample mean with inclusion indicators: each is one with probability f. But they aren't independent: the sample size is fixed, so including one person makes including another slightly less likely, a small negative covariance. Expanding the variance of the sum, Part 5's way, gives the variance of the mean: S squared over n, times one minus n over N. That factor is the finite-population correction. It's zero when the sample is the whole population, since a census has no sampling error, and very close to one whenever the sample is a small fraction of the population.
Let the World's polling firm run two thousand honest polls, each a simple random sample of a thousand adults. Their estimates of Blue's share spread with a standard deviation of one and a half points, just as the formula says. And they're centred on the truth: a random sample has no bias. The number of Blue voters in each poll follows Part 3's hypergeometric distribution exactly; nothing here is an approximation except the normal curve we'll draw around it.
That's why polls have about a thousand people. The margin of error for a share is one point nine six times the square root of p times one minus p over n. At its worst, p equal to a half, that's about one over the square root of n. So plus or minus three points needs about eleven hundred people. And the size of the population hardly matters. The finite-population correction is one minus n over N, essentially one for a thousand people out of seven hundred thousand or out of three hundred million. When both populations are much larger than the sample, an equally designed poll has nearly the same sampling accuracy in each.
When does the correction matter? When the sample is a large share of the population. Take one town of eleven hundred adults and sample half of them, to estimate their mean income. Now one minus n over N is a half, and the standard error is seventy-one percent of the naive one. With the correction, the ninety-five percent intervals cover the town's mean ninety-three point seven percent of the time. Without it, ninety-eight and a half percent: too wide, but not wrong. Leaving out the correction is always conservative. The small shortfall with it comes from the skew of incomes, Part 11's old enemy, not from the design.
A cousin of simple random sampling deserves a word, because it's what Bowley did. When N is an integer multiple of n, in systematic sampling divide the list into stretches of k and pick a random starting point in the first. Then take every k-th unit after it. Each unit has the same chance, one in k. If the list is ordered, by street or by size, the sample is automatically spread across the order: an implicit stratification, often more precise than an SRS. But if the list has a period that matches k, say every tenth flat on a register is a corner flat, the sample can be wildly unrepresentative, and nothing in the data will warn you.
There's an old line about this. You don't have to eat the whole pot to know how the soup tastes, as long as it's well stirred. The stirring is the randomization. And a spoonful's accuracy depends on the size of the spoon, not of the pot. If the soup isn't stirred, a whole bucketful from the top tells you only about the top. That's the Digest.
Numbers: SD 1.52 vs 1.54; n ≈ 1,100 for ±3; town of 1,114: 93.7% vs 98.5%
5StratificationBachelor's4 min
If the frame tells us something about everyone, we can use it before sampling. Split the population into groups, called strata, whose sizes we know. Take a simple random sample in each, and combine the stratum means with their population weights. The strata are sampled independently, so the variance is a weighted sum of within-stratum variances. The differences between strata, which an SRS has to estimate along with everything else, contribute nothing: the design has fixed each stratum's share exactly.
An example where it matters. Suppose we want the World's mean income, from a sample of a thousand, and the tax register tells us everyone's income band: under thirty thousand, thirty to a hundred, over a hundred. The bands differ enormously. The top band holds seven and a half percent of adults, but its standard deviation is a hundred and sixty thousand, twenty-eight times the bottom band's, because the Pareto tail of Part 1 lives there.
How many to take from each band? Minimize the variance for a fixed total sample size. With a Lagrange multiplier, each stratum's term must have the same marginal value, which gives n h proportional to the stratum's size times its standard deviation. Alexander Tschuprow found it in 1923, and Neyman, independently, in 1934. Proportional allocation, sampling each stratum in proportion to its size, is the special case where every stratum is equally variable. Neyman's rule says: sample more where the population is more variable.
Proportional allocation takes three hundred and thirty-four from the bottom band, five hundred and ninety-one from the middle and seventy-five from the top. Neyman's allocation takes eighty, four hundred and twenty-three, and four hundred and ninety-seven: half the sample from the richest seven and a half percent of adults, where all the uncertainty is. It isn't a biased sample: each of them carries a small weight in the estimate, their stratum's share divided by its sample size.
The results. A simple random sample of a thousand estimates mean income with a standard error of one point eight thousand. Stratifying with proportional allocation brings it to one point four five. Neyman's allocation: point seven six, less than half the SRS's, as good as a simple random sample of about fifty-six hundred. The simulation over three thousand samples agrees with the formulas. The SRS's simulated spread is a little below its formula, because with the Pareto tail a few enormous incomes dominate the variance; the stratified designs control exactly that.
Stratification isn't always dramatic. Stratify the vote by the World's ten regions: Blue's share ranges from thirty to forty-six percent across them, a real difference. An SRS's variance per respondent is p times one minus p. A proportionally stratified sample's is the weighted average of the within-region values, and the gain is just one and a half percent. However different the regions' averages, the people within each region differ far more. Stratification pays when the strata explain a large share of the variance, as the income bands did for income.
Often the grouping is known only after the interview: a person's age, or region, isn't on the frame. Then we post-stratify. Give each respondent a weight: their group's population share divided by its share of the sample. The weighted mean uses the same stratum shares, after the fact. Its random cell sizes change the variance; it can work well when all cells are adequately populated and response is ignorable within them. It needs the groups' population shares, usually from a census. Chapter nine extends it to many variables at once, and to samples that weren't random to begin with.
Numbers: S_h 5.8, 17.2, 159.5; SE 1.80 / 1.44 / 0.76 (simulated 1.67 / 1.44 / 0.76); region strata gain 1.5%
6Clusters and stagesMaster's5 min
A simple random sample of a thousand people scatters them over most of the island's towns, and face-to-face interviews mean sending someone to each. It's far cheaper to choose twenty towns at random, then fifty adults within each. That's a two-stage cluster sample. Twenty trips instead of a hundred and fifty. The catch: people in the same town tend to resemble each other, so fifty neighbours carry less information than fifty strangers.
The resemblance is measured by the intraclass correlation: the correlation between the votes of two adults in the same town, from Part 13's analysis of variance. In the World it's tiny, point oh one five six: towns differ only slightly, mostly because regions do. But it's multiplied. Under an equal-size exchangeable-cluster model, Leslie Kish's approximate design effect is one plus m minus one times rho, where m is the number per cluster: one point seven six with fifty per town. So the cluster sample's thousand interviews are worth a simple random sample of five hundred and sixty-seven. A correlation too small to notice costs almost half the sample, which is fine if it halves the cost, but the analysis must know about it.
Here's one cluster sample: the share for Blue in each of the twenty towns, fifty adults each. Overall, thirty-seven point three percent. The SRS formula pretends the thousand people were independent: a standard error of one point five three points. The design-based standard error treats the twenty towns as the independent units: the spread of the town shares over the square root of twenty. In this sample it happens to be close, one point five nine. Over many samples, though, the difference shows.
The Board: ten thousand cluster samples of twenty towns and fifty adults. With the SRS formula, ninety-five percent intervals cover the truth eighty-four percent of the time: broken, as the design effect predicts. With the cluster standard error and a t-multiplier on nineteen degrees of freedom, ninety-three percent: much closer, a little short. The rest is a small bias: choosing towns with equal chances and then fifty adults in each over-represents people in small towns, whose votes differ slightly. Fixing that is the next idea.
Clusters raise a second question: should every town have the same chance? Suppose we want the World's total income from a sample of ten towns, which range from five hundred to a hundred and forty thousand adults. With equal chances, we'd multiply the average town total by two hundred, and the estimate would swing wildly depending on whether the capital happened to be drawn. Morris Hansen and William Hurwitz, at the US Census Bureau in 1943, drew towns with probability proportional to size, and divided each town's total by its probability. Since a town's total income is roughly its size times the mean, that ratio is nearly the same for every town, and the estimate barely varies.
Four thousand samples of ten towns each. With equal probabilities, the estimates average roughly the truth, thirty-six point seven million, but their standard deviation is thirty-eight million: as large as the thing being estimated. With probabilities proportional to size, the standard deviation is a fifth of a million. A standard deviation a hundred and seventy-four times smaller, from ten town draws in each design. This assumes town totals are available; enumerating larger towns would cost more. Both designs are unbiased. Only one is useful.
Real surveys combine everything in this chapter. A national household survey, such as a labour force survey that measures unemployment, stratifies the country by region and by urban and rural areas; draws areas within each stratum with probability proportional to size; then households within each area, and sometimes one person per household. Standard errors come from formulas that follow the design, or from replicate weights: the survey releases dozens of alternative weight columns, made by Part 16's jackknife or bootstrap applied to the clusters, and each estimate is recomputed with every column. The rule is to analyse as designed. Software that treats survey records as independent observations will report standard errors that are much too small.
Numbers: ICC 0.0156, deff 1.76, n_eff 567; one sample 37.3%, SE 1.53 naive vs 1.59; Board 84.4%, 93.4%; PPS SD 0.22 M vs 38.1 M (SD ratio 174)
7Horvitz-ThompsonPhD4 min
Probability proportional to size is one design among many. Daniel Horvitz and Donovan Thompson, in 1952, gave an estimator for all of them. Let pi i be the probability that unit i is in the sample, whatever the design. Estimate the population total by adding, over the sampled units, each value divided by its inclusion probability. Taking expectations over the design, each unit appears with probability pi i and contributes y i over pi i, so the estimator is exactly unbiased, provided every unit has some chance. One over pi i is the design weight: a unit drawn with probability one in a hundred stands for a hundred units of the population.
A check by brute force. Five units, with values three, seven, one, nine and four, each included independently with a probability proportional to a size measure. There are thirty-two possible samples. Here are the four most likely, with their probabilities and their Horvitz–Thompson estimates, which range widely. Average the estimate over all thirty-two samples, weighting each by its probability: exactly twenty-four, the true total. Unbiasedness here is not an approximation; it's algebra.
The variance involves the joint inclusion probabilities, the chance that two units are both sampled. A. R. Sen in 1953, and Frank Yates and Patricia Grundy the same year, gave an unbiased variance estimates under their design conditions, including positive pairwise inclusion probabilities where needed. Its message is simple: for positive y and a fixed-size sample, feasible inclusion probabilities proportional to y make every term y over pi constant and the total has zero variance. With random-size Poisson sampling, the number of terms still varies, so constant contributions alone do not give zero variance. We don't know y, but a size measure correlated with it gets close, which is what chapter six's probability proportional to size did with town populations.
Unbiasedness isn't everything, as Debabrata Basu showed in 1971 with a famous story. A circus owner has to ship fifty elephants and needs their total weight. Three years ago he weighed them all, and Sambo, the middle elephant, was about average. So his plan is to weigh Sambo again and multiply by fifty. The circus statistician is horrified: that isn't a probability sample, and there's no way to say how accurate it is. Instead he proposes a design: choose Sambo with probability ninety-nine in a hundred, and each of the other forty-nine elephants with probability one in four thousand nine hundred.
Sambo is drawn, of course. The Horvitz–Thompson estimate is Sambo's weight times a hundred over ninety-nine: about one elephant's weight, for a herd of fifty. Had the giant Jumbo been drawn instead, the estimate would have been Jumbo's weight times four thousand nine hundred. On average over the design, the estimator is exactly unbiased. And it's absurd. In Basu's story the circus owner fires the statistician, who becomes a teacher of statistics. The moral is not to abandon randomization but to design with what you know: inclusion probabilities should track the quantity being measured, and an estimator should be judged by its whole distribution, not only its mean.
For a mean, the Horvitz–Thompson estimate divides the weighted total by the known population size. Jaroslav Hájek suggested dividing instead by the sum of the weights, the sample's own estimate of N. It is generally biased, often only slightly for well-behaved large samples; an empty sample also needs a convention. When the sample size is random or the weights uneven it's usually much less variable: it doesn't let a lucky draw of heavily weighted units inflate the total. Every survey dataset you'll meet carries a weight column of this kind: one over the inclusion probability, adjusted, as chapter nine will show.
Numbers: 32 samples average exactly 24
8Ratio and regression estimatorsMaster's5 min
The idea is old. Around 1802 Pierre-Simon Laplace estimated the population of France for Napoleon's government, without a census. Every parish registered its births, so the total number of births was known. What was missing was the number of people per birth. So Laplace had the population counted in a sample of communes spread across the country: two million and thirty-seven thousand people, with seventy-one thousand eight hundred and sixty-six births a year. That's twenty-eight point three five people for each birth. France registered about a million births a year, so the population was about twenty-eight point three five million. Laplace even attached a probability to his error, one of the first margins of error ever computed for a sample.
In general: we want the total of y, the population, and we know the total of an auxiliary variable x, births, for everyone. Estimate the ratio of y to x from the sample, and multiply by the known total of x. It works well when y is roughly proportional to x, a line through the origin, because then the ratio barely varies from one unit to the next, and a sample pins it down precisely.
Laplace's estimate has a familiar shape. In Part 3 we estimated the fish in the World's lake: mark M fish, release them, and later catch C, of which R are marked. The estimate of the total is M times C over R. Laplace's births play the part of the marked fish: a total known exactly, scaled up by the ratio of people to births found in the sample. Both are ratio estimators, which is why Laplace's survey is often described as the first capture–recapture study.
For a mean, the ratio estimator is the sample mean of y over the sample mean of x, times the known population mean of x. By Part 9's delta method, its variance depends only on the spread of the residuals from the line y equals R x, where the plain mean's variance depends on the whole spread of y. When x explains most of y, the gain is large. The price is a small bias, of order one over n, because a ratio of means isn't unbiased for the ratio, under regularity and a population auxiliary mean bounded away from zero. It need not be negligible for small, skewed samples or an unstable denominator.
On the World: suppose the tax register holds everyone's income for last year, known exactly, and we survey this year's. The two correlate at point nine five. One sample of four hundred: its plain mean is forty-six point six five thousand, and this year's incomes run at ninety-eight percent of last year's in the sample. The ratio estimate multiplies that by the register's known mean: fifty point oh four. The truth is forty-nine point four eight. The plain mean was off by almost three thousand, because this sample happened to miss a few high earners; the ratio estimator corrected for that, since the same people were missing from last year's register too.
Over three thousand samples, the plain mean has a standard deviation of three point oh four thousand. The ratio estimator's is point nine one: as precise as a plain sample eleven times the size. Its small bias, three hundredths, is invisible beside that. Auxiliary information known for the whole population is the cheapest precision there is.
When the relation isn't a line through the origin, use the regression estimator: correct the sample mean of y by the slope times how far the sample mean of x missed the known population mean. The slope is Part 12's least squares. With several auxiliary variables this becomes the generalized regression estimator, GREG, equivalent to choosing weights for the respondents so that the weighted sample reproduces every known population total: calibration. It's called model-assisted: the estimator is design-consistent under suitable regularity even if the working regression is wrong, and can be more efficient when auxiliary variables predict the outcome well. It is not generally exactly unbiased in a finite sample. It unites chapter three's two views.
Numbers: Laplace 2,037,615 / 71,866 = 28.35 → 28.35 million; register ratio estimate 50.04 vs truth 49.48; SD 0.91 vs 3.04
9WeightingPractice4 min
A real survey's weight has three layers. The design weight, one over the inclusion probability; a nonresponse adjustment; and a calibration factor. The nonresponse adjustment divides by the estimated response rate within cells of similar people, so that respondents stand in for the nonrespondents who resemble them. Calibration then adjusts the weights so that weighted totals match what a census says: by age, sex, region, education. Estimates are weighted means. Weighting can't create information, but it can rebalance it.
How is the nonresponse adjustment made? Group everyone who was sampled into cells, using information known for responders and nonresponders alike, such as region and age from the frame. In each cell, the response rate is the share who answered. Each responder's weight is multiplied by one over their cell's response rate, so that they stand in for the nonresponders who resemble them. With many variables, a logistic regression of responding on the frame variables, Part 14's model, gives each person a propensity, and its inverse is the weight. The same idea, inverse probability weighting, returns in Part 35 for causal inference.
Here's calibration by raking, on the World's Digest returns. The returns are far too rich and too old: ten percent come from the bottom income band, against a third of the population, and twenty-four percent are over sixty-seven, against eighteen. W. Edwards Deming and Frederick Stephan, preparing the 1940 US census, invented the fix. Scale the weights so the income shares match the census exactly. That knocks the age shares out a little, so now scale them to match age. Income is slightly off again; repeat. The adjustments shrink rapidly: after four rounds both margins match to within a ten-thousandth. It's iterative proportional fitting, and it converges whenever a solution exists.
The result. The raw returns said fifty-eight percent Blue. Raked to the census margins of region, age and income, they say forty-nine. The truth is thirty-eight. Weighting removed less than half the error. And it had a cost: the weights range from point one seven to nearly eight, and Kish's effective sample size falls from thirty-four and a half thousand to seventeen thousand. That's still plenty of precision. It's the bias that remains.
Why can't weighting finish the job? It assumes that within each weighting cell, the people who responded resemble the people who didn't. That's Donald Rubin's condition of missing at random, which Part 41 makes precise: the chance of responding depends only on things we've weighted for. On the World it's false. Blue voters return their ballots more often than Red voters at every income, every age, in every region: the response depends on the answer itself. No reweighting on income, age or region can correct that. The Digest's nonresponse was missing not at random, the hardest kind.
On the Board, two hundred fresh mailings: the raked Digest returns, with a plug-in independent-unit standard error using the weights, cover the truth zero times. That formula is not a full design-based variance calculation, and cannot remove the eleven-point bias.
So: weights correct for the variables you weight on, and only those. Kish's effective sample size describes weight dispersion under a working independent, equal-variance model. It does not measure selection bias or the precision gains from useful calibration variables. The best weighting variables predict both who responds and what they answer. A probability sample, weighted for its modest nonresponse, beats a huge self-selected one. And forgetting one such variable has consequences, as the American polls of 2016 found with education, which is the last chapter's story.
Numbers: raw 58.0% → raked 49.1%; weights 0.17–7.8; n_eff 16,941; Board 0%
10PollsPractice6 min
Gallup's triumph of 1936 used quota sampling. Each interviewer had to fill quotas: so many men and women, so many young and old, so many from each region and class. But within the quotas, the interviewer chose whom to ask. And interviewers, reasonably, chose people who were easy to find and willing to talk, who differ from those who aren't. It's chapter three's purposive selection in a new form: no lottery, and so no theory of the error.
In 1948 quota sampling had its own disaster. Gallup's final poll had Thomas Dewey, the challenger, at forty-nine and a half percent and President Harry Truman at forty-four and a half. Truman won, with forty-nine point six. All three major pollsters had called it for Dewey. A committee of the Social Science Research Council, led by Frederick Mosteller, found several causes: the quota interviewers' choices, polls that stopped weeks before the vote, and the assumption that the undecided would split like the decided. Afterwards the pollsters moved to probability samples of households.
From the 1970s, polls dialled telephone numbers at random: a true probability sample of telephones. But people stopped answering. The Pew Research Center's typical telephone survey reached thirty-six percent of the people it tried in 1997, and six percent by 2018. The original telephone draw has known probabilities, but the respondents' overall inclusion probabilities also depend on unknown response propensities, and Meng's correlation is back. So every modern poll is weighted, and its accuracy depends on whether the weighting variables capture who answers.
The World can show why. Its polling firm dials twenty thousand random numbers; about one in ten answers. First suppose answering depends only on income and age. The raw poll overstates Blue at forty-two percent; raked to income, age and region it comes back to thirty-nine, closer to the truth of thirty-eight. MAR alone does not make this coarse marginal raking exact: continuous propensities and interactions can leave residual bias. Now suppose answering also depends on the vote, as it does among the World's Digest readers. The raw poll says fifty-one, and weighting only brings it to forty-eight. The same weighting variables, with response rates of about eight and eleven percent; the key difference is whether response also depends on the answer once the weights' variables are accounted for.
In 2016, national polls in the United States were close to the result: Hillary Clinton won the popular vote by two point one points, and the polls averaged about three. But state polls in Michigan, Wisconsin and Pennsylvania underestimated Donald Trump, and those states decided the election. The American Association for Public Opinion Research's review found two main causes. Voters who decided late broke for Trump. And many state polls didn't weight by education, although college graduates are more likely to answer polls, and that year voted heavily for Clinton. A missing weighting variable, exactly chapter nine's lesson.
In 2020 the national polls overstated Joe Biden's winning margin by about three point nine points, the largest polling error in forty years, according to AAPOR's 2021 task force. This time most polls did weight by education, and late deciders didn't explain the miss. The task force couldn't prove a cause, but the leading explanation was that Trump's supporters were less likely to take part in polls, even after accounting for age, education and everything else the polls weighted on. Nonresponse that depends on the answer itself: the Digest's problem, eighty-four years later, at a small fraction of the size, and still beyond the reach of weighting.
Can a self-selected sample ever be rescued? Sometimes, with a strong model. In 2012 a poll was run on Microsoft's Xbox games console, open to anyone who wanted to answer. It collected about seven hundred and fifty thousand interviews from three hundred and forty-five thousand distinct respondents who were ninety-three percent men and mostly young: about as unrepresentative as a poll can be. Taken raw, it favoured Mitt Romney. Wei Wang, Andrew Gelman and colleagues fitted a multilevel regression of vote on demographics and then post-stratified it to the composition of the electorate. Their estimates came close to the result, and to the best probability polls. The model did the work the lottery couldn't, which only succeeds if, within its cells, the people who answered resemble those who didn't. Part 25 builds the method.
So: ask how a sample was chosen before you ask how big it is. A margin of error covers sampling error only. A simple random sample makes the data defect correlation zero in expectation, with random error in each realized sample, nonresponse brings it back, and weighting fixes only what it can see. Models of the population can help further: multilevel regression and post-stratification in Part 25, and the theory of missing data in Part 41.
Numbers: Gallup 1948 Dewey 49.5 / Truman 44.5, result 45.1 / 49.6; MAR 42.3 → 39.0%, MNAR 50.8 → 47.8%; 2020 error 3.9 points
Recap, problems, and the road aheadAll tracks3 min
Part eighteen in fourteen lines. The Literary Digest's two point four million ballots were wrong because of whom they reached and who replied. Meng's identity splits any sample's error into data quality, quantity and difficulty, and showed the World's Digest worth six random voters. Design-based inference puts the randomness in our own lottery, and a simple random sample of a thousand gives about three percentage points of sampling margin for a large population under simple random sampling. Stratification with Neyman's allocation halves the error; clustering costs precision, measured by the design effect; probability proportional to size can save it a hundredfold. Horvitz–Thompson weighting is unbiased for any design, though Basu's elephants show that isn't everything. Ratio and regression estimators borrow strength from known totals. Weights and raking correct what they can see, which is why the polls of 1948, 2016 and 2020 went wrong in different ways.
Where it comes back. Part 19 turns to prediction and how to evaluate it honestly, and Part 20, the bachelor's capstone, takes an analysis from question to report. Part 25 builds multilevel models and the MRP method pollsters now use. Part 35 treats causal inference as a missing-data problem, with Horvitz–Thompson weights in a new role. Part 41 gives missing data its full theory. Part 49 shows when weighting is efficient. And Part 63 asks how a census can publish its counts without revealing anyone.
Six problems, with full solutions in the README. The finite-population correction in a town; the covariance of inclusion indicators; Neyman's allocation for two strata; an effective sample size from Meng's identity; a design effect; and the unbiasedness of Horvitz–Thompson. Pause here if you want to try them.
The books and papers this part follows: Sharon Lohr's Sampling, Cochran's and Kish's classics, Särndal, Swensson and Wretman's model-assisted survey sampling, and Groves and colleagues' survey methodology, with the papers from Laplace and Neyman to Meng and the polling post-mortems.
Eighteen parts of sixty-five, the eighth of Stage II. We can now say whom a sample speaks for, and how to make it speak for more. Next, a different goal: prediction. In the 1960s Frederick Mosteller and David Wallace settled who wrote twelve disputed Federalist papers, Alexander Hamilton or James Madison, by counting words like upon and whilst. Part 19: learning from data.
Where it goes next. The survey block's vote is the classification example of Part 19 and design weights carry the capstone in Part 20; MRP returns in Part 25, inverse probability weighting in Part 35, missing-data mechanisms in Part 41, and census privacy in Part 63.
Key results
The part's results in one place, for revision.
Try it
Lab 18 · A huge biased sample against a small random one
Mail a ballot to everyone on the World's telephone-and-car registers, let people answer with their own propensities, and compare the error of the tens of thousands of returns with Meng's identity and with two thousand simple random samples of 1,000.
python -m videos.stats.labs 18
needs numpy, scipy, matplotlib · download lab18.py ·
source on GitHubBlue's true share of the adults 38.2% (N = 741,311)
the Digest's returns 57.8% from 34,488 ballots (the listed alone: 46.8%)
Meng: rho x sqrt((1-f)/f) x sigma 0.0888 x 4.53 x 0.486 = +0.1954 (actual error +0.1954)
the returns are worth a random sample of 6.2 people
2,000 random samples of 1,000: sd 0.0150 (theory with the fpc 0.0154)
one random sample of 1,000 36.6%, 95% CI [33.6%, 39.6%]
95% intervals that cover the truth 95.7%
The size of a sample multiplies its error only through sqrt((1 - f)/f); a correlation of 0.09 between answering and voting Blue is enough to make tens of thousands of ballots worth fewer than a dozen random voters.
The code (77 lines; it asserts its own result)
"""Lab 18: rerun the Literary Digest on the World, and check Meng's identity against a random sample of 1,000."""
import numpy as np
from videos.coursekit import labs
from explainer.stats.kit import survey
from explainer.stats.world import World
TITLE = "A huge biased sample against a small random one"
GOAL = ("Mail a ballot to everyone on the World's telephone-and-car registers, let people answer with their own "
"propensities, and compare the error of the tens of thousands of returns with Meng's identity and with "
"two thousand simple random samples of 1,000.")
TASKS = [
"Mail every adult instead of the registers (drop `listed`). How much of the error was the frame's?",
"Stratify the random sample by region with proportional allocation (survey.stratified_mean). How much does the SD fall?",
"Rake the returns to the population's income bands with survey.rake and recompute the error and Kish's n_eff.",
]
def run(seed=0):
rng = np.random.default_rng(seed)
w = World()
adult = w.adult
s = w.survey
y = s["vote_blue"][adult].astype(float) # 1 = votes Blue
listed, prop = s["listed"][adult], s["propensity"][adult]
N, truth = len(y), y.mean()
lab = labs.Lab()
# the Digest: a ballot to every listed adult; each returns it with their own propensity
returned = listed & (rng.random(N) < prop)
m = survey.meng(y, returned)
digest = y[returned].mean()
frame_bias = y[listed].mean() - truth
n_eff = m["sigma"] ** 2 / m["error"] ** 2 # the SRS size with the same mean squared error
lab.row("Blue's true share of the adults", f"{truth:.1%} (N = {N:,})")
lab.row("the Digest's returns", f"{digest:.1%} from {m['n']:,} ballots (the listed alone: {truth + frame_bias:.1%})")
lab.row("Meng: rho x sqrt((1-f)/f) x sigma", f"{m['rho']:.4f} x {np.sqrt((1 - m['f']) / m['f']):.2f} x {m['sigma']:.3f} = "
f"{m['identity']:+.4f} (actual error {m['error']:+.4f})")
lab.row("the returns are worth a random sample of", f"{n_eff:.1f} people")
assert abs(m["error"] - m["identity"]) < 1e-9, "Meng's identity is exact"
assert abs(m["error"] - (digest - truth)) < 1e-12 and m["error"] > 0.15, "the Digest is far off, towards Blue"
assert 0 < frame_bias < m["error"], "the frame explains part of the error, nonresponse the rest"
assert n_eff < 12 and abs(n_eff - m["n_eff"]) < 0.5, "tens of thousands of ballots are worth a handful of voters"
# simple random samples of 1,000, without replacement
n, reps = 1000, 2000
polls = np.array([y[rng.choice(N, n, replace=False)].mean() for _ in range(reps)])
sd_theory = np.sqrt((1 - n / N) * y.var(ddof=1) / n)
one = survey.srs_mean(y[rng.choice(N, n, replace=False)], N)
cover = np.mean(np.abs(polls - truth) < 1.96 * np.sqrt((1 - n / N) * polls * (1 - polls) / (n - 1)))
lab.row("2,000 random samples of 1,000: sd", f"{polls.std(ddof=1):.4f} (theory with the fpc {sd_theory:.4f})")
lab.row("one random sample of 1,000", f"{one['mean']:.1%}, 95% CI [{one['ci'][0]:.1%}, {one['ci'][1]:.1%}]")
lab.row("95% intervals that cover the truth", f"{cover:.1%}")
assert abs(polls.mean() - truth) < 0.002 and abs(polls.std(ddof=1) / sd_theory - 1) < 0.06, "unbiased, with the SRS variance"
assert 0.93 < cover < 0.97 and m["error"] > 8 * sd_theory, "1,000 random voters beat the Digest by an order of magnitude"
lab.note = ("The size of a sample multiplies its error only through sqrt((1 - f)/f); a correlation of 0.09 between "
"answering and voting Blue is enough to make tens of thousands of ballots worth fewer than a dozen random voters.")
fig, ax = labs.figure(2, size=(11, 4.2))
ax[0].hist(100 * polls, bins=40, color=labs.BLUE, alpha=0.7, label="2,000 random samples of 1,000")
ax[0].axvline(100 * truth, color=labs.GREEN, label=f"truth {truth:.1%}")
ax[0].axvline(100 * (truth + frame_bias), color=labs.ORANGE, ls="--", label=f"everyone listed {truth + frame_bias:.1%}")
ax[0].axvline(100 * digest, color=labs.RED, label=f"the Digest's returns {digest:.1%}")
ax[0].set(title="Blue's share: random samples and the Digest", xlabel="estimate of Blue's share (%)", ylabel="samples",
xlim=(32, 84))
ax[0].legend(loc="upper right")
f = np.logspace(-4, np.log10(0.9), 200)
for rho, color in ((m["rho"], labs.RED), (0.02, labs.ORANGE), (0.005, labs.GOLD)):
ax[1].plot(f * N, 100 * rho * np.sqrt((1 - f) / f) * m["sigma"], color=color, label=f"self-selected, rho = {rho:.3f}")
ax[1].plot(f * N, 100 * np.sqrt((1 - f) / (f * N)) * m["sigma"], color=labs.BLUE, label="random sample: sd")
ax[1].scatter([m["n"]], [100 * m["error"]], color=labs.RED, zorder=5)
ax[1].set(xscale="log", yscale="log", title="Error against sample size (Meng's identity)", xlabel="sample size n",
ylabel="error in Blue's share (points)", ylim=(0.01, 100))
ax[1].legend(loc="lower left")
lab.fig = fig
return lab
Now change it
- Mail every adult instead of the registers (drop `listed`). How much of the error was the frame's?
- Stratify the random sample by region with proportional allocation (survey.stratified_mean). How much does the SD fall?
- Rake the returns to the population's income bands with survey.rake and recompute the error and Kish's n_eff.
Problems, with solutions
Try each problem before opening its solution.
1. The fpc in a town. A town of 2,000; an SRS of 400 gives \(\bar y = 52\), \(s = 20\). The SE with and without the fpc.
Solution
Without the fpc, the SE is s/√n = 20/20 = 1.0. With it, multiply by √(1 − 400/2000) = √0.8: about 0.89.
2. The covariance of inclusion indicators. Show that for an SRS without replacement, \(\mathrm{Cov}(R_i, R_j) = -f(1 - f)/(N - 1)\).
Solution
P(Rᵢ = Rⱼ = 1) = n(n − 1)/(N(N − 1)), so Cov(Rᵢ, Rⱼ) = n(n − 1)/(N(N − 1)) − n²/N². Simplify with f = n/N: f[(n − 1)/(N − 1) − f] = f(n − N)/(N(N − 1)) = −f(1 − f)/(N − 1).
3. Neyman allocation for two strata. Two strata, \(N_1 = N_2\), \(S_1 = 1\), \(S_2 = 3\), \(n = 100\): Neyman's allocation, and its variance vs proportional.
Solution
Here n_h ∝ N_h S_h ∝ S_h, so n₁ = 25 and n₂ = 75. Ignoring the fpc, with W₁ = W₂ = ½:
- Neyman: Var = ¼(1/25) + ¼(9/75) = 0.01 + 0.03 = 0.04.
- Proportional: n₁ = n₂ = 50, so Var = ¼(1/50) + ¼(9/50) = 0.05.
Neyman's allocation has 20% less variance.
4. An effective sample size. A self-selected sample of 1% of a population has \(\rho_{R,Y} = 0.01\). Its effective sample size.
Solution
n_eff = f/(1 − f)/ρ² = (0.01/0.99)/0.0001 ≈ 101. Whatever the population's size, the self-selected 1% is comparable to about a hundred random people on this squared-error scale, ignoring the comparison SRS's finite-population correction.
5. A design effect. Cluster sample, 30 per cluster, ICC 0.05: the design effect, and \(n_{\text{eff}}\) for 1,500 interviews.
Solution
deff = 1 + (30 − 1) × 0.05 = 2.45, so n_eff = 1,500/2.45 ≈ 612.
6. Horvitz–Thompson is unbiased. Show that the Horvitz–Thompson total is unbiased for any design with all \(\pi_i > 0\).
Solution
Write T̂ = Σᵢ Rᵢyᵢ/πᵢ over the whole population. Then E[T̂] = Σᵢ E[Rᵢ]yᵢ/πᵢ = Σᵢ πᵢyᵢ/πᵢ = Σᵢ yᵢ = T. This holds for any design, provided every πᵢ > 0; otherwise some units can never be seen.
Notes and sources
Where it comes back
| Idea | Returns in |
|---|---|
| prediction and honest evaluation | 19 |
| a full analysis, question to report | 20 |
| multilevel models and MRP | 25 |
| inverse probability weighting for causal effects | 35 |
| missing data: MCAR, MAR, MNAR, imputation | 41 |
| the efficiency of weighting estimators | 49 |
| privacy for censuses | 63 |
| the Coverage Board | every part; 65 |
Glossary
- Population, frame, sample: who we want to describe; the list we sample from; whom we actually observe.
- Coverage (frame) bias: error from a frame that differs from the population.
- Nonresponse bias: error from response that depends on the answer.
- Total survey error: sampling, coverage, nonresponse and measurement error together.
- Data defect correlation ρ_{R,Y}: the population correlation of being in the data with the value; Meng's identity.
- Effective sample size: the size of an SRS with the same accuracy (Meng's; Kish's for weights; n/deff for clusters).
- Design-based inference: probability statements from the known selection mechanism, with fixed population values.
- Purposive selection: choosing units by judgment to resemble the population.
- Finite-population correction: the factor 1 − n/N in an SRS variance.
- Systematic sampling: every k-th unit from a random start.
- Stratification; proportional and Neyman allocation: sampling within known groups, with n_h ∝ N_h or ∝ N_h S_h.
- Post-stratification: weighting to known group shares after sampling.
- Cluster and multistage sampling: sampling groups (towns), then units within them.
- Intraclass correlation; design effect: within-cluster similarity; the variance ratio 1 + (m − 1)ρ.
- PPS sampling; Hansen–Hurwitz estimator: probability proportional to size, with replacement.
- Inclusion probability πᵢ; design weight 1/πᵢ; Horvitz–Thompson estimator: Σ yᵢ/πᵢ, unbiased for any design.
- Hájek estimator: the weighted mean Σ wᵢyᵢ/Σ wᵢ.
- Ratio and regression estimators; GREG; calibration: using auxiliary totals known for the population.
- Raking (iterative proportional fitting): weighting to several margins at once.
- MAR, MNAR: response depending only on observed cells, or on the answer itself.
- Quota sampling: interviewers fill demographic quotas without random selection.
- MRP: multilevel regression and post-stratification.
- Replicate weights: alternative weight columns (jackknife, bootstrap) for design-based standard errors.
Sources
- The Digest and the polls.
- P. Squire, "Why the 1936 Literary Digest poll failed", Public Opinion Quarterly 52 (1988).
- F. Mosteller et al., The Pre-election Polls of 1948 (SSRC, 1949).
- AAPOR task force reports on the 2016 (2017) and 2020 (2021) election polls.
- Pew Research Center, "Response rates in telephone surveys have resumed their decline" (2019).
- W. Wang, D. Rothschild, S. Goel & A. Gelman, Int. J. Forecasting 31 (2015).
- Sampling theory.
- A. Kiær (1895, ISI Bern); A. Bowley, JRSS 76 (1913); J. Neyman, JRSS 97 (1934); A. Tschuprow, Metron 2 (1923).
- M. Hansen & W. Hurwitz, Ann. Math. Stat. 14 (1943); D. Horvitz & D. Thompson, JASA 47 (1952); A. R. Sen, J. Indian Soc. Agric. Stat. 5 (1953); F. Yates & P. Grundy, JRSS B 15 (1953).
- D. Basu and J. Hájek, in Foundations of Statistical Inference, ed. V. Godambe & D. Sprott (1971).
- W. E. Deming & F. Stephan, Ann. Math. Stat. 11 (1940); L. Kish, Survey Sampling (1965).
- X.-L. Meng, Ann. Appl. Stat. 12 (2018).
- P.-S. Laplace, Théorie analytique des probabilités (1812), book II, ch. 6.
- Books. S. Lohr, Sampling: Design and Analysis (3rd ed., 2022); W. Cochran, Sampling Techniques (3rd ed., 1977); C.-E. Särndal, B. Swensson & J. Wretman, Model Assisted Survey Sampling (1992); R. Groves et al., Survey Methodology (2nd ed., 2009).
About this partfrom its README
Part 18 of a sixty-five-part course in statistics, from a first course to a PhD (see the series plan and the syllabus), in Stage II, Bachelor's: Methods. Every part so far trusted that the data were a fair sample of something. This part asks how a sample comes to speak for a population, and what happens when it doesn't.
It opens with the Literary Digest of 1936: 2.4 million ballots, Landon 57%, and a Roosevelt landslide. The World reruns it with a new survey block: an election in which Blue, the challenger, has 38.2% of 741,311 adults. The World's Digest mails the island's telephone-and-car registers (208,339 people), gets 34,588 ballots back, and finds Blue at 58.0%. A simple random sample of 1,000 says 38.0%, with a 95% CI of [35.0, 41.0].
From there the part covers:
- What went wrong. Frame bias (+8.6 points: the listed are richer, and the rich vote Blue) and nonresponse bias (+11.2: Blue voters return 21% of ballots, Red voters 13%). Squire (1988). Gallup's forecast of the Digest's result. The total survey error.
- Meng's identity. The error of any sample is ρ_{R,Y} × √((1 − f)/f) × σ_Y, derived. For the World's Digest: ρ = 0.090, error 19.8 points exactly. Effective sample sizes: 34,588 ballots are worth 6 random voters; a self-selected half of the island (364,275 people) is worth 50. Error curves; the big-data paradox; two Board rows.
- Design-based inference. Kiær (1895), Bowley (1912), Neyman (1934) and Gini & Galvani's purposive sample. Fixed values with a random selection; finite population vs superpopulation; the lottery on the island map.
- Simple random sampling. The fpc derived; 2,000 polls of 1,000 (SD 1.52 points); why ±3 points needs about 1,100 people whatever N; the fpc in a town of 1,114 (coverage 93.7% with it, 98.5% without); systematic sampling.
- Stratification. Mean income by register band; Neyman allocation derived (80 / 423 / 497 against proportional 334 / 591 / 75); SE 1.80 (SRS), 1.44 (proportional), 0.76 (Neyman); stratifying the vote by region gains only 1.5%; post-stratification.
- Clusters and stages. 20 towns × 50 adults; ICC 0.0156; Kish's design effect 1.76 (n_eff 567); naive vs cluster SE; probability proportional to size (Hansen & Hurwitz 1943) a standard deviation 174 times smaller for total income; multistage designs and replicate weights; two Board rows.
- Horvitz–Thompson. Unbiased for any design, checked over all 32 Poisson samples; the variance; Basu's elephants (1971); Hájek's estimator.
- Ratio and regression estimators. Laplace's 1802 estimate of France (28.35 people per birth); capture–recapture as a ratio; the World's register of last year's income (corr 0.95): SD 0.91 vs 3.04, worth a sample 11 times larger; GREG and calibration.
- Weighting. Design, nonresponse and calibration weights; response-propensity cells; raking (Deming & Stephan 1940) animated; the raked Digest at 49.1% (Kish n_eff 16,941); MAR vs MNAR; one Board row.
- Polls. Quota sampling and 1948; falling response rates; a dialled poll in which raking fixes income-driven nonresponse (42.3 → 39.0%) but not vote-driven nonresponse (50.8 → 47.8%); 2016, 2020; the Xbox poll and MRP.
Every number on screen is computed in compute.py or inline in a scene:
- the election, the registers and who answers are the World's new survey block (seed 1662);
- incomes and towns are the World's;
- Laplace's, Gallup's and the polling-error figures are historical.
Built in this part:
-
The World's survey block (
World.surveyinexplainer/stats/world.py):vote_blue, likelier with income, age and some regions;listed, the telephone-and-car registers, likelier with income;propensity, the chance of returning a mailed ballot, higher for Blue voters and the well-off;turnout.
Adding it changes no earlier block.
-
statkit.survey(explainer/stats/kit/survey.py), checked intests/test_stats_kit_survey.py:- the SRS mean with the fpc;
- proportional and Neyman allocation, and stratified variances and means;
- the ICC, Kish's design effect and effective sample size;
- Hansen–Hurwitz and Horvitz–Thompson totals, and Poisson sampling;
- ratio and regression estimators;
- post-stratification, raking and weighted means;
- Meng's identity.
-
The island map (
IslandMapinexplainer/stats/viz.py): the World's coastline and 200 towns, sized by population and tinted by region, with highlighting for cluster samples.
The Coverage Board gains five rows: 95% intervals for Blue's share.
| Method | Setting | Reps | Achieved | Verdict |
|---|---|---|---|---|
| SRS of 1,000, Wald interval | the World's vote for Blue | 10,000 | 94.61% | kept |
| a self-selected half, n ≈ 364,000 | the World's vote for Blue | 200 | 0.00% | broken |
| 20 towns × 50, SRS formula | the World's vote for Blue | 10,000 | 84.35% | broken |
| 20 towns × 50, cluster SE | the World's vote for Blue | 10,000 | 93.43% | broken |
| Digest returns, raked | the World's vote for Blue | 200 | 0.00% | broken |
Chapter notes
| # | Chapter | Numbers |
|---|---|---|
| 0 | The Literary Digest, 1936 | truth 38.2%; listed 46.8%; returns 58.0% (34,588); SRS 38.0% [35.0, 41.0] |
| 1 | What went wrong | frame bias +8.6, nonresponse +11.2; return rates 20.6% Blue, 13.1% Red; median income 39k vs 56k listed; Gallup-style 3,000 → 489 replies, 59.3% Blue |
| 2 | Meng's identity | ρ = 0.0902, f = 0.0467, √((1−f)/f) = 4.52, σ = 0.486 → 0.1980; n_eff 6 and 50; Board 94.6%, 0% |
| 3 | Design-based inference | 29 of 214 districts (Gini & Galvani) |
| 4 | Simple random sampling | SD 1.52 vs 1.54; n ≈ 1,100 for ±3; town of 1,114: 93.7% vs 98.5% |
| 5 | Stratification | S_h 5.8, 17.2, 159.5; SE 1.80 / 1.44 / 0.76 (simulated 1.67 / 1.44 / 0.76); region strata gain 1.5% |
| 6 | Clusters and stages | ICC 0.0156, deff 1.76, n_eff 567; one sample 37.3%, SE 1.53 naive vs 1.59; Board 84.4%, 93.4%; PPS SD 0.22 M vs 38.1 M (SD ratio 174) |
| 7 | Horvitz–Thompson | 32 samples average exactly 24 |
| 8 | Ratio and regression estimators | Laplace 2,037,615 / 71,866 = 28.35 → 28.35 million; register ratio estimate 50.04 vs truth 49.48; SD 0.91 vs 3.04 |
| 9 | Weighting | raw 58.0% → raked 49.1%; weights 0.17–7.8; n_eff 16,941; Board 0% |
| 10 | Polls | Gallup 1948 Dewey 49.5 / Truman 44.5, result 45.1 / 49.6; MAR 42.3 → 39.0%, MNAR 50.8 → 47.8%; 2020 error 3.9 points |
| 11 | Outro | — |
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: the Literary Digest (1936). About 2.4 million returns predicted Landon; Roosevelt won about 61%.
- What went wrong. Frame and nonresponse bias (Squire 1988), recreated on the World.
- Meng's identity (2018). Error = data defect correlation × √((N − n)/n) × σ, derived; the effective size of a huge biased sample (Board).
- Design-based inference (Neyman 1934). Kiær (1895); Bowley.
- Simple random sampling. The finite-population correction derived.
- Stratification. Neyman allocation n_h ∝ N_hS_h, derived; post-stratification.
- Clusters and stages. Kish's design effect; PPS (Hansen & Hurwitz 1943).
- Horvitz–Thompson (1952). Unbiasedness; Basu's elephants (1971).
- Ratio and regression estimators. Laplace (1802) again; GREG.
- Weighting. Raking (Deming & Stephan 1940) animated; nonresponse adjustment.
- Polls. Quota sampling and 1948; the 2016 and 2020 polling errors (AAPOR reviews).
- Outro.
Built: the World's polling firm; statkit.survey.
Build the film
python -m videos.stats.stats18.compute # the part's numbers, into .cache/stats18
python tools/build.py stats18 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py stats18 Hook # one chapter, silent, with a contact sheet
Scenes: videos/stats/stats18. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.stats.stats18.compute # once (about a minute; cached in .cache/stats18)
python tools/build.py stats18 -q l # fast 480p preview
python tools/build.py stats18 # 1080p30 -> renders/stats18.mp4
python tools/qa_scene.py stats18 Meng
python tools/lecture_length.py stats18 --floor 50