SStatistics, Built

Stage III · Master's

Part 41 of 65

What You Didn't See

Master'sstarts at this level56 min of film11 chaptersprerequisites: Part 18, Part 22, Part 36

Data are missing or mismeasured: when does it matter, and what can be done?

In 1943 Wald is shown where returning bombers were hit and says to armour where they were not: the planes hit there are the ones that did not return. The part gives the idea its definitions. Rubin's three mechanisms say whether missingness depends on nothing, on what was seen, or on the missing value itself, and the World's income survey is masked under each. Complete cases, mean imputation and last observation carried forward each fail in a way that can be computed. Under missing at random the likelihood ignores the mechanism, so EM fits a normal with holes, and multiple imputation with Rubin's rules carries the uncertainty that a single imputation hides. Weighting respondents by the inverse of their response probability is the causal inference of Part 36 under another name. When the value itself drives the missingness nothing in the data can show it: Heckman's model, pattern mixtures and tipping points are assumptions made explicit. The part ends with MRP for a self-selected poll, and with measurement error, which attenuates a slope by the reliability.

What you need. Survey weighting (Part 18), likelihood (Part 22), and propensity scores and AIPW from Part 36.

Hook
Wald's bombers, 1943
Mathematics
Rubin's mechanisms, EM and FIML, multiple imputation, IPW/AIPW, Heckman, MNAR sensitivity, measurement error, MRP
Built
statkit.mi

What you will be able to do

Bachelor's

  • Explain Wald's argument about the bombers as a statement about which data are missing.
  • Show by example what complete cases, mean imputation and LOCF each do to a mean, a spread and a correlation.

Master's

  • Classify a missingness mechanism as MCAR, MAR or MNAR and derive ignorability under MAR.
  • Combine m completed-data analyses by Rubin's rules and compute the fraction of missing information.
  • Estimate a mean with missing outcomes by IPW and AIPW, and correct a slope for classical measurement error by regression calibration.

PhD

  • Explain why MAR cannot be tested against MNAR from the observed data, and what Heckman's exclusion restriction and normality buy.
  • State the congeniality condition under which Rubin's variance is valid.

Practice

  • Report an analysis with missing data: the mechanism assumed, the imputation model, and a tipping-point sensitivity analysis.
  • Adjust a self-selected poll by MRP and say what residual selection the cells cannot remove.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Bachelor's 12 min · Master's 50 min · PhD 56 min · Practice 22 min.

  1. 0Wald's bombersBachelor's3 min
  2. 1MechanismsMaster's5 min
  3. 2The easy methods' sinsBachelor's6 min
  4. 3Likelihood under MARMaster's5 min
  5. 4Multiple imputationMaster's7 min
  6. 5Weighting is causal inferenceMaster's5 min
  7. 6Missing not at randomPhD6 min
  8. 7MRPPractice5 min
  9. 8Measurement errorMaster's7 min
  10. 9MisclassificationPractice5 min
  11. 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. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.

Wald's bombersBachelor's3 min

In 1943 Abraham Wald, a mathematician at Columbia University's Statistical Research Group, was asked where to put armour on bombers. Armour is heavy, so it can go only where it does the most good, and the data were the bullet holes in the planes that came back. The planes that did not come back, the ones that held the answer, could not be inspected. They were missing precisely because of what had happened to them.

A stylized version. Of two thousand bombers sent out, each hit a few times at random over its surface, came back. Here are the hits on the ones that returned. The fuselage and the wings are peppered. The engines have few holes. The obvious conclusion was to armour where the holes are.

Wald's reasoning: bullets and flak land roughly in proportion to area. So if the returning planes have few engine hits, the missing engine hits must be on the planes that did not return: a hit there brought the plane down. Armour the places where the survivors were not hit. Wald went further, and his memoranda, reconstructed by Marc Mangel and Francisco Samaniego in 1984, estimated how lethal a hit in each area was from the size of each deficit.

The numbers. The engines are fifteen percent of the surface but carry only percent of the survivors' hits: thirty percent of the hits expected from area alone are missing in relative-share terms. This is not the per-hit kill probability: normalizing by all survivors’ hits changes the denominator. The fuel system is short too. The fuselage and wings carry more than their share, because hits there were survivable. Under this toy model, relatively frequent surviving hits suggest less lethal locations, not places universally safe to be hit.

A note on the legend. The famous picture of a returning bomber covered in red dots was drawn decades later, and the details of the story have grown in the retelling. Wald's actual memoranda were mathematics: from the counts of hits on returning planes, he derived estimates of the chance that a hit in each area would bring a plane down. He treated the planes that never came back as data, missing for a reason he could model. It is an early analysis of data missing not at random.

Survivorship bias: the data that reach us have been filtered by the very outcome we care about. Investment funds that closed vanish from the averages; patients who felt worst leave the trial; people with something to hide do not answer the survey. This part asks three questions: why is it missing, does it matter, and what can be done about it. And it ends with a cousin of missing data: values we do see, but wrongly.

Numbers: engines 15% of surface, 10.5% of hits

1MechanismsMaster's5 min

Donald Rubin's paper of 1976 set out the framework. Split the data into the observed and the missing parts. Record which is which in a matrix R of response indicators, and treat R itself as random. The missing-data mechanism is the distribution of R given the data. Everything depends on what R depends on.

Three answers. Missing completely at random: the mask is a coin, independent of the variables whose missingness is being modelled. Missing at random, a misleading name: the chance of being missing may depend on the data, but only on parts we observe. Missing not at random: it depends on the missing values themselves, so the reason is hidden along with the data. For income on a survey: a form lost in the post is completely at random; younger people skipping the question is at random, if age is recorded; the well-off refusing to say is not at random.

The World's survey: two thousand adults asked five questions; here are the first twenty-four respondents, one row each, with their ages on the left. Thirty percent withhold their income, under three different mechanisms whose truth only the World knows. Completely at random, the dark cells are scattered. At random, they gather among the young. Not at random, they gather among the best-paid, which, crucially, we cannot see from the table.

Compare the missing with the observed. Under the coin, they are alike in age. Under missing at random, those who withheld income are about twelve years younger, a difference the data reveal. Under missing not at random, the ages barely differ, but the hidden incomes of the refusers are about twice as high, in geometric mean, and nothing in the observed data says so.

Missingness also has a shape. In a monotone pattern, once a value is missing all later ones are too, like a patient who leaves a trial and never returns; otherwise the holes are arbitrary. Monotone patterns allow simpler, sequential methods: impute the first visit, then the next given the first, and so on. Surveys distinguish unit nonresponse, where a person does not take part at all, from item nonresponse, where they skip one question. The first is usually handled by weighting, the second by imputation.

Why the distinction matters. The likelihood of what we saw, both the data and the mask, integrates over the missing values. Under missing at random, the mechanism depends only on observed values, so it comes out of the integral. The likelihood factors into a part for the mechanism and the ordinary likelihood of the observed data. If, in addition, their parameters are distinct, with a variation-independent parameter space, we can ignore the mechanism entirely and maximize the observed-data likelihood under a correctly specified observed-data model. Bayesian ignorability also needs the relevant prior factorization. Under MNAR, the mechanism must be modelled.

Karthika Mohan and Judea Pearl draw the mechanism as part of a causal graph, with the response indicator as a node. In a simple graph without hidden common causes, no data-variable arrows into the response indicator is sufficient for completely at random; arrows only from always-observed variables can represent missing at random. General missingness graphs require more care than these sufficient examples. Graphs show that some MNAR situations still allow some quantities, such as a regression of y on x, to be estimated consistently, and they make explicit which assumption each method rests on: Part thirty-six's back-door reasoning applied to the mask.

In a trial the distinction becomes concrete. If patients leave because of symptoms recorded at their last visit, the dropout is missing at random given the recorded history. If they leave because of how they felt in the weeks after it, which was never recorded, it is not. So the difference is often a matter of how often outcomes are measured. And the reasons patients give for leaving are themselves data about the mechanism, worth collecting carefully.

Which mechanism holds? Completely at random can be tested: systematic differences on observed variables can contradict it, allowing for sampling variation and the test’s modelling assumptions. Failure to reject does not establish MCAR. Roderick Little gave the standard test in 1988. But missing at random against not at random cannot be tested: for every MNAR model there is a MAR model that fits the observed data exactly as well, as Geert Molenberghs, Michael Kenward and colleagues proved in 2008. So MAR is argued from how the data were collected, and its importance is measured by sensitivity analysis, the subject of chapter six.

Numbers: missing 39 vs observed 51 years old

2The easy methods' sinsBachelor's6 min

The default in most software is to drop every row with a hole. If the data are missing completely at random, what remains is a smaller random sample: unbiased, but wasteful. Under missing at random, the remaining rows are a selected sample, and the unadjusted marginal mean can be biased when the selection depends on something that predicts the outcome. And the waste compounds: if the missingness indicators across ten variables are independent and each variable is five percent missing, only sixty percent of the rows survive.

On the World's survey, the true mean log income of all two thousand, in gold. Under the coin, the complete cases are fine. Under missing at random, they are a little high, because the young, who earn less, answered less; here age predicts income only weakly, so the bias is small. Under missing not at random, the complete cases are far too low, and their interval is confident and wrong.

There is a useful exception. If missingness depends only on the covariates of a regression, a correctly specified conditional regression can still be estimated from complete cases, provided selection leaves adequate covariate support, because, given x, being observed tells us nothing more about y. That fails if missingness depends on the outcome itself. And even when the regression is fine, the complete-case marginal mean of y need not be, because the complete cases have the wrong mix of x. The Board tests both.

Another shortcut fills a missing covariate with zero and adds an indicator for having been missing. Sander Greenland and William Finkle showed in 1995 that it can bias covariate coefficients even when the data are missing completely at random, because the filled zeros distort the covariate's relation to everything else. There is one honest use: for baseline covariates in a randomized trial, where randomization protects the treatment comparison. Whether a method is safe depends on the design, not only on the data.

Available-case analysis computes each mean, variance and covariance from whatever rows have the variables it needs. It uses more of the data than complete cases. But the resulting covariance matrix need not be positive definite: its entries can form an indefinite matrix even though individually computed pairwise correlations stay between minus one and one; regressions built on it can be nonsense. Each entry describes a different subsample, so the assembled entries can be incoherent as one covariance matrix. Under MCAR they can still be consistent, so incoherence is a finite-sample possibility rather than a universal failure.

Filling the holes is tempting. With incomes missing completely at random, filling them with the observed mean leaves the mean right, but shrinks the standard deviation by a sixth and pulls the correlation with age toward zero. Filling with a regression prediction is better, but every filled value lies exactly on the regression line, so the spread is too small and the correlation too strong. Stochastic draws under a suitable model can restore the missing residual variation in distribution; one draw need not reproduce either statistic exactly. That is the first step toward multiple imputation; the second, chapter four, is admitting that we do not know the regression either.

Where the holes are matters as much as why. If only the outcome is missing, and at random given the covariates, under a correctly specified conditional outcome model, with no additional auxiliary information, complete cases already provide its likelihood information: imputing from that same model creates no new information. Auxiliary measurements and different estimands can change the comparison. If covariates are missing, dropping those rows throws away their outcomes and their other covariates, which carry real information. This is one reason imputation can be especially helpful when the holes are in the covariates.

In clinical trials the classic shortcut was to carry a dropout's last observation forward to every later visit. It assumes the disease stops changing on the day the patient leaves. It was the default for decades, until a 2010 report of the US National Research Council on missing data in trials argued against it. A seeded trial: symptom scores worsen by two points a month on placebo and one on the drug, and patients whose symptoms are worse are likelier to drop out.

The true average scores, for everyone, rise steadily in both arms, faster on placebo. With the last observations carried forward, both curves flatten, because each dropout is frozen at an earlier, better score. Placebo patients drop out more, so its curve is flattened more, and the gap between the arms, the treatment effect, shrinks.

The treatment effect at month five. The truth is points. Carrying values forward understates it, at . Here the completers alone happen to land near the truth, and an imputation that assumes dropouts would have continued like similar patients who stayed recovers it too. LOCF is neither conservative nor safe: its bias can go either way, depending on how dropout and disease interact.

Numbers: SD 0.653 → 0.544; LOCF −4.47 vs −4.84

3Likelihood under MARMaster's5 min

A real data set with holes: daily air quality in New York from May to September 1973, one of R's oldest examples. Ozone is missing on of the days, and solar radiation on . Dropping incomplete days leaves , throwing away a quarter of the data. Missing at random is a working assumption, not established by this table. We have not verified the causes of each missing monitor reading; and temperature and wind, always recorded, carry information about it.

For a multivariate normal with holes, EM alternates two steps. The E-step replaces each missing block by its conditional expectation given that row's observed values, Part five's regression formula, and remembers the conditional variance, the uncertainty of the fill. The M-step computes the usual mean and covariance from the filled data, adding those variances back, so the spread is not understated. Arthur Dempster, Nan Laird and Donald Rubin proved in 1977 that the observed-data likelihood never decreases.

The idea is older than EM. In 1960 S. F. Buck filled holes in a multivariate data set by regressing each variable on the others. Crucially, he added the residual variance back when computing the covariance matrix, so the filled values did not shrink it. The conditional-moment correction anticipates normal-model EM. A generic cycle of regression fills is not automatically EM or guaranteed to maximize the same likelihood. The lesson runs through this part: filling holes is fine, as long as the uncertainty is put back.

Ozone against temperature on the days it was measured. The gold ticks mark the days with no ozone reading, at their temperatures; they are spread across the range. EM's E-step places each at its conditional mean given that day's sunlight, wind and temperature. The filled values sit on the regression surface; the M-step's added variance accounts for the scatter they lack.

The observed log-likelihood climbs at every iteration and settles within . The mean ozone from the complete cases is parts per billion; EM's maximum likelihood estimate is . They are close, because the days without readings were, on average, just as hot as the others. EM helps most when the missing differ on the observed predictors; and its covariance accounts for conditional imputation uncertainty under the fitted normal model. Skewed ozone and an incorrect missingness model can still produce bias.

Why EM climbs. The observed log-likelihood splits into Q, the expected complete-data log-likelihood, minus a term H. Q averages the complete log-likelihood over the missing values' conditional distribution at the current guess. By Jensen's inequality, H is largest at the current guess. So any step that raises Q raises the likelihood, the argument of Part twenty-two, here with the missing values as the latent variables.

The information in the observed data is the information we would have had with complete data, minus the information the holes took away: Orchard and Woodbury's missing information principle. Locally, under regularity conditions, EM’s convergence matrix is a matrix fraction of missing information; its dominant eigenvalue controls the asymptotic rate, so high relative missing information can slow convergence. That ratio alone does not determine absolute interval width, which also depends on sample information and parameter scale. Standard errors come from Louis's formula, from Meng and Rubin's supplemented EM, or from the bootstrap.

Maximizing the observed-data likelihood directly is called full-information maximum likelihood: each row contributes the likelihood of whatever it has. It is the standard in structural equation software, and has the same observed-data objective as EM; agreement requires reaching the same optimum, and EM need not find a unique global maximum. Its standard errors must come from the observed information, which Thomas Louis showed in 1982 how to extract from EM. Its weakness is that the missing-data model and the analysis are one and the same; a different analysis may require changing the joint model, though multiple estimands can be extracted from one fitted joint model. Multiple imputation separates them.

Numbers: EM in 12 iterations

4Multiple imputationMaster's7 min

Rubin invented multiple imputation for public data files, such as the Census Bureau's. The agency that collects the data understands why values are missing; thousands of analysts who later use the file do not, and use ordinary software. So the agency makes several completed copies, each with the holes filled by random draws from a model, and each analyst runs the usual analysis on every copy and combines the results by simple rules.

The survey grid, with incomes missing at random. Fill each hole with a draw from its predictive distribution given the respondent's age, sex, region and BMI. Do it again, and again: each copy gets different draws. Where the copies disagree, we are uncertain about the missing values, and that uncertainty is what single imputation hides.

Rubin's rules. The combined estimate is the average of the m estimates. W is the average of their squared standard errors, the within-imputation variance; B is the variance of the estimates across copies, the between-imputation variance. The total variance is W plus B inflated by one plus one over m, for using finitely many copies. Intervals use a t distribution whose degrees of freedom grow as B shrinks relative to W, refined for small samples by John Barnard and Rubin in 1999.

The rules come from the law of total variance, read in a Bayesian way: the posterior variance of a quantity given the observed data is the average of its variance if the data were complete, plus the variance, across the plausible completions, of its value. W estimates the first, B the second. With finitely many copies the average itself has simulation error, B over m. The share of the total variance due to the holes, is a large-degrees-of-freedom relative variance share. The reported finite-sample FMI also includes a degrees-of-freedom correction; it is often far smaller than the fraction of missing values.

The draws must be proper. Adding noise to the fitted regression treats its coefficients as known, and understates B. A proper imputation first draws the residual variance and the coefficients from their posterior, then draws the missing value from that regression. Predictive mean matching, popularized by Roderick Little, instead borrows an observed value from a donor whose prediction is close, so each imputation stays within the observed donor support. This does not guarantee that a value is plausible for every covariate pattern or that the joint model is correct: no negative incomes, no fractional children.

With holes in many variables, Stef van Buuren's chained equations are the standard. Impute each variable in turn from all the others, each with a model suited to it, a linear regression, a logistic, or predictive mean matching. Check mixing and convergence across chains rather than assuming a fixed number of sweeps suffices. This demonstration uses ten sweeps, and repeat from scratch for each copy. The conditional models need not fit together into any joint distribution, and incompatible conditionals can create inconsistent results or dependence on update order. Diagnostics and sensitivity to the imputation models matter.

New York's ozone again, now regressing its log on sunlight, wind and temperature. Complete cases use a hundred and eleven days; twenty imputations by chained equations use all hundred and fifty-three. The estimates and standard errors are similar. The fractions of missing information, a fifth to a third, say why: the forty-two partly missing days carry less information than their number suggests, because their missing ozone is exactly the quantity being modelled.

The twenty estimates of the temperature coefficient, one per completed data set. Their average is the combined estimate. Their scatter, the square root of B, is about two thirds of the typical within-copy standard error, the square root of W; together they give the total standard error and the degrees of freedom of the t interval.

How many copies? Rubin's answer was that a handful suffice: with five copies and thirty percent missing information, the estimate is ninety-four percent as efficient as with infinitely many. But standard errors and p-values need more copies to stop wobbling from one run to the next. A useful large-sample planning approximation is one plus gamma squared divided by twice the desired squared relative Monte Carlo standard deviation of the reported standard error, and since computing is cheap, twenty to a hundred copies are common starting points; high missing information or precise tail probabilities can require more.

One rule matters above all. Xiao-Li Meng called it congeniality: the imputation and analysis procedures must have compatible assumptions. Including the analysis variables is necessary practical advice, but not by itself a full congeniality theorem. Impute a covariate without using the outcome, and the imputed values carry no relation to the outcome, so the estimated association is diluted toward zero. Analyse an interaction the imputer ignored, and it is attenuated in the same way. So impute with every variable the analysis will use, including the outcome, and any others that predict the missing values or the missingness.

Derived variables need thought: a body mass index computed from height and weight, a squared term, an interaction. Imputing the ingredients and then computing the derived value keeps the arithmetic consistent, but can lose the relationships the analysis cares about. Treating a derived term as another imputed variable can help for some analyses, but may break deterministic identities. Passive imputation or substantive-model-compatible chained equations can preserve the required nonlinear and interaction structure. For interactions with a group, impute separately within each group, so that each group keeps its own relationships.

Numbers: FMI 0.17–0.34; 70.8% vs 89.3%

5Weighting is causal inferenceMaster's5 min

Weighting attacks the problem from the other side. Model the chance of responding given the always-observed variables. Under missing at random, weighting each respondent's value by one over that chance with the known true response probability gives an unbiased Horvitz-Thompson mean, under positivity and suitable moments. The normalized Hájek version divides by the sum of the weights; it and estimators using fitted probabilities generally have finite-sample bias but can be consistent. Each respondent stands in for one over pi people like them: Part eighteen's Horvitz-Thompson estimator, with the response propensity in place of a designed inclusion probability.

This is causal inference in disguise, or the other way round. Responding plays the role of being treated; the outcome of a non-respondent is an unseen potential outcome; missing at random is no unmeasured confounding; the response propensity is the propensity score; and the estimators are the same. Rubin built the potential-outcome framework and the theory of missing data at the same time, because a potential outcome you did not observe is a missing value.

The augmented estimator of James Robins, Andrea Rotnitzky and Lue Ping Zhao combines both approaches: predict everyone's outcome from a regression, then correct the predictions by the weighted residuals of the respondents. If the outcome model is right, the correction averages to zero. If the response model is right, the correction removes the outcome model's bias. Consistent if either is right, double robustness, under regularity and suitable nuisance-estimation rates, when both are right it attains the semiparametric efficiency bound, a fact Part forty-nine explains.

All three methods on the World's three masks. Under the coin, all agree with the truth. Under missing at random, multiple imputation and weighting both remove the complete cases' bias. Under missing not at random, all three are equally wrong. These implementations do not correct this MNAR mechanism; other identifying restrictions or validation information could change what is recoverable.

Double robustness in numbers, on the missing-at-random mask. Weighting with the right response model, which uses age and region, removes the bias; with a wrong one, built on BMI, it does not. In this finite example, the rich outcome regression is a working approximation, not the simulator’s known exact conditional mean. The double-robustness theorem concerns consistency if either nuisance model is correct: wrong outcome with right weights, or right outcome with wrong weights. With both wrong, it fails like the rest.

Survey statisticians usually weight differently: they adjust the weights so that the sample reproduces known population totals, by age, sex or region. Raking, from Part eighteen, is one such calibration, and the generalized regression estimator is another. For suitable calibration distances and model classes, calibration equations can be related to an implied response model; and Jean-Claude Deville and Carl-Erik Särndal developed the calibration framework. Consistency under either an implied response model or a suitable linear outcome model needs the relevant design, support and calibration assumptions; arbitrary calibration weights are not automatically doubly robust.

Weights cost precision. Here the largest is , and the respondents have a weight-only Kish effective sample size of about units. This is a diagnostic, not a universal equivalence in outcome precision. With stronger selection, a few respondents can carry enormous weights, and the variance explodes. The remedies are those of Part thirty-six: check overlap and consider augmentation or carefully justified weight modification. Trimming can introduce bias or change the target; multiplying all normalized weights by one constant does not fix extreme relative weights. Imputation and weighting assume the same thing, missing at random; they differ in which part of the problem they model.

Weights should be checked the way Part thirty-six checked propensity scores, by balance. After weighting, the respondents should resemble the whole sample on every observed variable: age, sex, region. On the World's survey, the weighted respondents' age distribution matches the full sample's, while the unweighted one is several years too old. Balance is a useful diagnostic; exact finite-sample balance is not necessary for every valid estimated-propensity procedure. It is never sufficient, because the assumption that matters is about what we do not see.

Numbers: AIPW right if either model is

6Missing not at randomPhD6 min

The classic case comes from economics. A wage is seen only for someone who works. In the 1970s many married women did not work for pay, and economists reasoned that a woman took a job when the wage she was offered beat the value of her time at home. So observed wages are selected on the wage itself: missing not at random. There are two ways forward: model the selection explicitly, or measure how much it could matter.

James Heckman's model of 1979, for which he shared the Nobel prize. An outcome equation for the wage everyone is offered, a selection equation for whether one works, a probit, and errors that are jointly normal and correlated: unobserved ambition might raise both the wage and the chance of working. Then the mean observed wage is the regression plus a term rho sigma times the inverse Mills ratio of the selection index. Ordinary least squares on workers omits that term.

The inverse Mills ratio, phi over Phi of the selection index. It is large for people who were unlikely to be selected, whose presence in the sample says their error must be unusually favourable; near zero for those who would almost surely be selected. Heckman's two-step method fits the probit, computes each worker's ratio, and adds it as a regressor; maximum likelihood fits both equations at once.

Thomas Mroz's data of 1987, married women from the 1975 wave of the Panel Study of Income Dynamics. worked for pay. Of women with no child under six, percent worked; with one, ; with two, . Using young children as an exclusion assumes that, conditional on the included covariates, they affect participation but not offered log wages. Effects through availability, past experience or other channels can violate this assumption: an exclusion restriction, like Part thirty-seven's instruments.

The results. Ordinary least squares on the workers says a year of education is associated with a log-wage difference of about percent. Heckman's two steps and maximum likelihood agree. The estimated correlation is close to zero: within this restrictive joint-normal model, the fitted residual selection correlation is near zero. That estimate does not establish an absence of selection under other specifications. A famous model, and here a famous non-result, whose interpretation depends on exclusion and distributional assumptions.

Heckman's model needs care. Without a variable that shifts selection but not the outcome, the Mills ratio is almost a linear function of the regressors, and the model is identified only by the exact shape of the normal distribution. The answer then rests on an assumption no data can check, and the estimates swing widely. Roderick Little and Charles Manski urged treating selection models as one sensitivity analysis among several, not as the answer.

At the other extreme, assume nothing. For an outcome between zero and one, the missing values could be anything in that range. So the mean is bounded below by assuming every missing value is zero, and above by assuming every one is one, where p is the share observed: Charles Manski's worst-case bounds. Their width is exactly the missing share, honest but often too wide to be useful. Each defensible assumption, such as that refusers are no less likely to vote than responders, narrows them, the partial identification of Part thirty-seven.

A selection model factors the joint distribution as the outcome times the chance of responding given it. A pattern-mixture model, Little's alternative, factors it the other way: the chance of each pattern, times the outcome's distribution within each pattern. The simplest version says the non-respondents look like similar respondents, shifted by an amount delta. Delta cannot be estimated from the data. It is chosen, and varied, and the analysis reports how the conclusion moves with it.

A tipping-point analysis on the World's not-at-random mask. Impute under missing at random, then add delta to every imputed log income, for a range of deltas. At delta zero, the answer is the MAR one, far too low. As delta grows the estimate rises, and it reaches the truth, which only the World knows, near delta of : refusers earning about twice what similar respondents do. In a real study one reports the delta at which the conclusion would change, and asks whether so large a difference is plausible.

Regulators now expect this: the international guideline on estimands of 2019 asks trials to state the target effect in the presence of intercurrent events, such as stopping treatment. Treatment discontinuation is not itself the same as missing follow-up data; and to show sensitivity analyses. Trials assume, for example, that dropouts on the drug behave like the control arm afterwards. Following a probability subsample of non-respondents can inform the departure, but further nonresponse and measurement error still need to be addressed. And the best fix for missing data is the oldest: design the study so that less of it goes missing.

Numbers: ρ̂ ≈ 0.03; tipping δ ≈ 0.7

7MRPPractice5 min

Multilevel regression and poststratification. In 2012, players of Microsoft's Xbox game console could answer a daily poll on the US presidential election. The respondents were ninety-three percent men and two thirds aged eighteen to twenty-nine, and the raw numbers favoured Romney. Wei Wang, David Rothschild, Sharad Goel and Andrew Gelman showed that multilevel regression and poststratification turned this into a forecast as accurate as the major polls. A highly selected sample whose predictions improved under that modelling strategy; this does not guarantee that arbitrary selection can be repaired.

The idea. Divide the population into cells by the variables that drive both participation and opinion. Estimate the opinion in each cell. With hundreds of cells, many have few or no respondents, so a raw average per cell is useless; a model is needed. Then weight each cell's estimate by its size in the population, from a census: Part eighteen's poststratification. The assumption is missing at random given the cells: within a cell, those who answer are like those who do not.

Andrew Gelman and Thomas Little's model of 1997 is a logistic regression with an effect for each age group, sex, region and income group, each set of effects drawn from a normal distribution with its own spread. Small cells borrow strength from similar ones, Part twenty-five's partial pooling, and the spreads, estimated from the data, decide how much.

The World holds an election in which percent of adults support the challenger, Blue. An online poll invites anyone to join; three thousand do. Twice as many are under thirty as in the population, and two thirds are men. The raw poll puts Blue at percent, four points too high, because the young, the men and the well-off who join lean Blue.

Against the truth, in gold. The raw poll is percent, with a confident interval that misses. Raking the weights to the population's age, sex, region and income margins brings it to . MRP, with six age groups, two sexes, ten regions and five income groups, gives percent, about six tenths of a percentage point above the truth, and this approximate ninety percent interval contains the target in this run. It uses a normal approximation at the posterior mode, conditional on fitted group spreads.

MRP is also used for small areas. The ten regions, true support against estimate. The raw regional shares mostly sit above the diagonal, with a root mean squared error of percentage points, because each region's joiners are skewed the same way. MRP removes that shared skew, with a root mean squared error of . The gain is modest, because some regions had only sixty respondents, and the model pools group effects while adjusting for cell composition, while the World's regions differ for reasons no census variable explains. Small-area estimates improve most when area-level predictors, such as past votes, explain the differences between areas; with them, MRP has estimated opinion in every US state and British constituency from national polls.

MRP entered public life in Britain in 2017, when the polling firm YouGov published constituency-by-constituency estimates from a model of this kind. Most polls expected a large Conservative majority; the model suggested a hung parliament, which is what happened. It has missed in other elections. MRP is a model, and its accuracy depends on the cells capturing who answers.

The limits. MRP corrects only for what defines the cells. If those who join an online poll differ from those who do not even within a cell, for example by political interest, nothing in the model can see it. It needs population counts for every cell, the joint table, which censuses do not always publish. And honest intervals must carry all the model's uncertainty, including the spreads of the group effects. Our teaching intervals fix those spreads at their grid-selected estimates and omit that source of uncertainty.

MRP belongs to a larger family, small-area estimation, which we met in Part twenty-five with Fay and Herriot's model. Area-level models shrink each area's direct survey estimate toward a regression on area characteristics. Unit-level models, like MRP, predict every person in the population and add them up. Both trade a little bias for a lot of variance, and both need intervals that carry the model's uncertainty.

Numbers: 42.3% → 38.9% (truth 38.2%)

8Measurement errorMaster's7 min

The classical model of measurement error: what we record is the truth plus independent noise. The reliability is the share of the recorded variance that is signal. Measure the same thing twice, with mutually independent, mean-zero classical errors of equal variance, and their population correlation equals the common reliability. Unequal error variances give the geometric mean of the two reliabilities instead. Charles Spearman, in 1904, used this to correct correlations between mental test scores: divide by the square root of the reliability, the correction for attenuation.

In a regression on the true exposure, replacing it by an error-prone measurement shrinks the slope by the reliability: regression dilution. A reliability of one half halves the estimated effect. With error-free covariates and classical error independent of them, the relevant attenuation can be stronger after adjustment, because the reliability that matters is the error-prone variable's, given the others. Classical error in the outcome, by contrast, adds noise but no bias.

A picture. Two hundred points with a true slope of two, and the same points with the exposure measured with error of the same variance as the signal. Each point slides sideways by its error; the cloud stretches horizontally, and the fitted line flattens to about half the true slope.

Part twenty's real example. NHANES asks about everything eaten in the past twenty-four hours, twice, on different days. The two days' sodium intakes correlate only : low repeatability is consistent with substantial day-to-day variation and reporting error, but does not establish an independent classical-error model for usual intake, which is what matters for blood pressure. Regressing systolic pressure on one day's sodium gives millimetres of mercury per gram, indistinguishable from zero. On the average of two days, the slope roughly doubles, consistent with less dilution, though these unweighted complete-case associations do not identify a causal sodium effect.

Regression calibration replaces the error-prone exposure by its best prediction of the truth. With a replicate, that prediction comes from regressing the second recall on the first and the covariates, under the assumption that the second error has conditional mean zero given the true exposure, the first measurement and covariates. Shared reporting bias can violate it. Then refit with the prediction in place of the raw value. In NHANES the attenuation factor given age and sex is , and the corrected slope is millimetres per gram, still uncertain but four times the naive one. Its uncertainty must account for both stages, by a joint bootstrap or an appropriate analytic calculation, because the calibration is itself estimated.

SIMEX, John Cook and Leonard Stefanski's simulation-extrapolation of 1994, runs the problem backwards. Add extra noise to the exposure, lambda times the error variance. Refit, many times, and watch the slope fall as the noise grows. Then extrapolate the curve back to lambda equal minus one, where the total error variance would be zero. It needs the error variance, again from replicates, and a guess at the curve's shape, usually a quadratic.

A seeded check with twenty thousand people, a true slope of two and a reliability of point three nine. The naive slope is , and adding more error pushes it lower. Extrapolating the quadratic back to minus one gives : better, but short, because the true curve, a ratio with the total error variance in its denominator, is not a quadratic, and bends sharply near minus one. Regression calibration, with its replicate, gives . SIMEX is most useful when the error is modest; with low reliability, its extrapolation is a long way out.

A replicate can also serve as an instrument, in the sense of Part thirty-seven. The slope of y on the first measurement, instrumented by the second, is the covariance of the second with y over its covariance with the first. It works because the second measurement's error is independent of the first's and of the outcome, an exclusion assumption that must be justified; routine repeat dietary recalls do not guarantee it. In the linear model the two can target the same population slope under classical-error assumptions, but they generally differ in finite samples. Calibration uses covariance of W one with Y divided by covariance of the replicates, while this IV estimator uses covariance of W two with Y in the numerator: two views of one idea.

When both variables are measured with error, as when two laboratory methods are compared, W. Edwards Deming's regression minimizes distances to the line weighted by the ratio of the two error variances, the errors-in-variables model of Part twenty-three. With equal error variances it is orthogonal regression, the first principal component of Part thirty-one. Without knowing the ratio, the slope is not identified for normal data at all, as Olav Reiersøl proved in 1950.

Not all error is classical. In Berkson error, the recorded value is fixed, a dose of radiation assigned to a district, and each person's true exposure scatters around it; a correctly specified exogenous linear slope remains unbiased when the Berkson deviation has conditional mean zero given the recorded exposure. Errors correlated with the truth, or different for cases and controls, can bias in either direction. With several mismeasured covariates, a confounder measured badly leaves residual confounding, and signs can flip. A broader modelling approach treats true values as latent variables, but identification still needs validation information or defensible restrictions and priors: Part twenty-six's tools.

The consequence most often forgotten: adjusting for a confounder measured with error removes only part of its confounding. Propensity scores built from noisy covariates inherit the problem. So measure key exposures and confounders twice, at least on a subsample, because a validation study is to measurement error what a follow-up of non-respondents is to missing data: a direct source of information about the mechanism, alongside replicates and other defensible identifying information.

Numbers: repeat-day correlation 0.34; conditional working λ = 0.24; RC 0.77

9MisclassificationPractice5 min

Misclassification is measurement error for categories. A seeded case-control study: a thousand cases and a thousand controls, each asked whether they were exposed. Memory is imperfect: eighty percent of the exposed say yes, and ninety percent of the unexposed say no. The true odds ratio is two point five, and two point two nine in this particular sample. At first, everyone misremembers in the same way: nondifferential misclassification.

The share who say they were exposed mixes the truly exposed who remember with the unexposed who wrongly say yes. If sensitivity and specificity are known, this inverts: the true share is the reported share, minus the false positives, divided by the sum of sensitivity and specificity minus one. Correct cases and controls separately, then form the odds ratio. The catch is the same as before: the error rates must come from a validation study, here perhaps medical records for a subsample.

How much is the odds ratio diluted? The truth is two point five. With specificity ninety percent, the odds ratio formed from expected observed cell proportions falls steadily as sensitivity drops, and with perfect specificity it falls much more slowly. Nondifferential misclassification of a binary exposure pulls the population odds ratio toward one in this simple unconfounded setting with common error rates and sensitivity plus specificity greater than one. It is not a statement about every finite-sample estimate, and when the exposure is uncommon, false positives among the many unexposed do more damage than missed exposures.

The study's tables. In truth, cases and controls were exposed. As recalled, the counts are blurred, and the odds ratio drops to . Correcting with the known error rates gives , back near the truth, as a point correction. We have not computed an interval here; uncertainty must propagate sampling variation and any estimated error rates. Incompatible error-rate assumptions can even imply corrected proportions outside zero and one, requiring a constrained model rather than blind clipping.

Real case-control studies have a worse problem, recall bias: people who have a disease search their memories harder for possible causes. Suppose cases recall an exposure ninety percent of the time and controls seventy. The observed odds ratio is now , above the truth: differential error can exaggerate an effect, or invent one. Correction is still possible, but only with separate error rates for cases and controls.

Outcomes are misclassified too: a disease defined from billing codes, a cause of death from a certificate. If some non-cases are counted as cases, with common informative error rates in both groups, population risk ratios are pulled toward one. But if the definition is perfectly specific, missing some true cases equally in both groups preserves the population risk ratio, because the same fraction of cases is lost from each. So in studies of risk, specificity can be especially valuable for a risk-ratio estimand, while sensitivity, precision and the study’s purpose still matter.

All these corrections rest on a validation substudy: the expensive gold-standard measurement on a few hundred people. It estimates the sensitivity and specificity, or the calibration of the error-prone measure on the true one. Choose it at random, perhaps within strata, and analyse it together with the main study. It is two-phase sampling, from Part eighteen, and the unvalidated majority can even be multiply imputed: missing data and measurement error are one subject.

A common reassurance says that nondifferential error only biases toward the null. For a binary exposure in the simple informative, nondifferential error model, it describes the population odds-ratio limit, rather than the exact expectation of a finite-sample ratio. But not necessarily in a single study, not for exposures with three or more categories, and not when confounders are mismeasured too, as Sander Greenland and others have stressed. And a small estimated effect, explained away as dilution, is not evidence that the true effect is large. The modern approach, probabilistic bias analysis, puts distributions on the error rates and simulates the range of corrected answers.

Numbers: OR 2.29 → 1.67 → 2.07

Recap, problems, and the road aheadAll tracks3 min

Part forty-one in twelve lines. Wald armoured the bombers where the survivors had not been hit. Rubin's mechanisms decide what can be learned: completely at random, at random, or not at random, and under MAR and distinct parameters, likelihood can ignore the mechanism while retaining a suitable observed-data model. Complete cases are fine for some questions and badly wrong for others. Mean imputation and carrying values forward distort and mislead. EM and full information likelihood use everything observed. Multiple imputation draws plausible values, analyses each copy, and combines by Rubin's rules, and the imputation model must include the outcome. Weighting by response propensities is causal inference, and the augmented estimator is doubly robust. When data are not missing at random, model the selection, as Heckman did, or vary the departure and find the tipping point. MRP repairs a self-selected poll, given the right cells. Measurement error dilutes slopes, and replicates let us correct them. And misclassification, especially when it differs by outcome, can push in either direction.

A promise for later. This part used weighting and its augmented version. Under regularity and appropriate nuisance fits, we took the augmented estimator’s asymptotic efficiency bound on trust. Part forty-nine proves it, with influence functions and the semiparametric efficiency bound. But first, Part forty-two: the comprehensive exam that closes the master's.

Where it comes back. Part forty-two's consulting case begins with missing values. Part forty-five studies EM's convergence and the information lost to missingness. Part forty-nine proves the augmented estimator's efficiency. Part sixty-two handles unmeasured confounding with proxies. And Part sixty-three treats the noise added for privacy as deliberate measurement error.

Six problems, with full solutions in the README. Rubin's factorization; complete cases selected on x; Rubin's total variance; the known-probability weighting and double-robust consistency; regression dilution; and the matrix method. Pause here if you want to try them.

The books this part follows: Little and Rubin; van Buuren on flexible imputation, and Rubin's own book; Carroll, Ruppert, Stefanski and Crainiceanu on measurement error; and the National Research Council's report on missing data in trials; with the papers from Spearman to Mohan and Pearl.

Forty-one parts of sixty-five. What we did not see shapes what we can conclude; ask why it is missing before asking what it was. Next, the master's ends with an exam: Part forty-two, a client, messy data, and a deadline.

Where it goes next. The comprehensive exam's second case starts with a missing confounder (Part 42); Part 45 proves EM's convergence and measures the information lost, Part 49 derives AIPW's efficiency, Part 62 uses proxies for unmeasured confounders, and Part 63 treats privacy noise as deliberate measurement error.

Key results

The part's results in one place, for revision.

Ignorability under MAR\(\displaystyle p(y_{\text{obs}},r\mid\theta,\psi)=p(r\mid y_{\text{obs}},\psi)\,p(y_{\text{obs}}\mid\theta)\)
Rubin's rules\(\displaystyle \bar Q=\frac1m\sum_{j=1}^m\hat Q_j,\qquad\allowbreak T=\bar W+\Bigl(1+\frac1m\Bigr)B,\qquad\allowbreak B=\frac{1}{m-1}\sum_j(\hat Q_j-\bar Q)^2\)
IPW and AIPW means\(\displaystyle \hat\mu_{\text{IPW}}=\frac1n\sum_i\frac{R_iY_i}{\pi(X_i)},\qquad\allowbreak \hat\mu_{\text{AIPW}}=\frac1n\sum_i\Bigl[m(X_i)+\frac{R_i}{\pi(X_i)}\bigl(Y_i-m(X_i)\bigr)\Bigr]\)
Heckman's correction\(\displaystyle E[Y\mid X,Z,S=1]=X^\top\beta+\rho\sigma\,\lambda(Z^\top\gamma),\qquad\allowbreak \lambda(u)=\frac{\phi(u)}{\Phi(u)}\)
Attenuation\(\displaystyle \operatorname{plim}\hat\beta_{\text{naive}}=\lambda\beta,\qquad\allowbreak \lambda=\frac{\sigma_x^2}{\sigma_x^2+\sigma_u^2}\)

Try it

Lab 41 · Complete cases, one imputation, and Rubin's rules

Simulate 500 samples of n = 300 with y = 1 + x + noise, hide y for 40% of rows with a probability that rises with x (missing at random), and compare the complete-case mean, a single regression imputation with its naive standard error, and multiple imputation (m = 10) pooled by Rubin's rules: bias, and coverage of 90% intervals.

Figure produced by Lab 41: Complete cases, one imputation, and Rubin's rules
Produced by the lab below, seed 0, in 0.4 s.
python -m videos.stats.labs 41 needs numpy, scipy, matplotlib · download lab41.py · source on GitHub
complete cases                        mean 0.576 (truth 1)   sd 0.106   mean SE 0.098   90% CI covers 0.0%
single imputation                     mean 1.005 (truth 1)   sd 0.103   mean SE 0.073   90% CI covers 74.2%
multiple imputation                   mean 1.005 (truth 1)   sd 0.105   mean SE 0.104   90% CI covers 89.6%
fraction of missing information (MI)  0.38

Complete cases are biased because the rows that remain have smaller x. Imputing from the regression removes the bias, but one imputation treated as data claims a standard error that is too small; Rubin's between-imputation variance puts the missing uncertainty back.
The code (81 lines; it asserts its own result)
"""Lab 41: lose 40% of an outcome at random given a covariate, and compare three ways of estimating its mean."""

import numpy as np
from scipy import stats

from videos.coursekit import labs
from explainer.stats.kit import mi

TITLE = "Complete cases, one imputation, and Rubin's rules"
GOAL = ("Simulate 500 samples of n = 300 with y = 1 + x + noise, hide y for 40% of rows with a probability that rises "
        "with x (missing at random), and compare the complete-case mean, a single regression imputation with its "
        "naive standard error, and multiple imputation (m = 10) pooled by Rubin's rules: bias, and coverage of 90% "
        "intervals.")
TASKS = [
    "Change the mask to kind 'mnar' with y itself as the driver. Which of the three methods still covers?",
    "Set m = 2, then m = 50. How do the interval's width and the fraction of missing information change?",
    "Replace kind='proper' by kind='stochastic' in the imputations (no draw of beta and sigma). What happens to coverage?",
]


def run(seed=0):
    rng = np.random.default_rng(seed)
    n, reps, m, mu, rate = 300, 500, 10, 1.0, 0.4
    z = stats.norm.ppf(0.95)
    names = ("complete cases", "single imputation", "multiple imputation")
    est = {k: np.empty(reps) for k in names}
    se = {k: np.empty(reps) for k in names}
    cover = {k: np.empty(reps, bool) for k in names}
    fmi = np.empty(reps)
    for r in range(reps):
        x = rng.standard_normal(n)
        y = mu + x + rng.standard_normal(n)
        miss = mi.mask("mar", n, rate, rng, driver=x)["miss"]
        y_obs = np.where(miss, np.nan, y)
        cc = y[~miss]
        single = mi.impute_norm(y_obs, x, rng, kind="mean")
        draws = [mi.impute_norm(y_obs, x, rng, kind="proper") for _ in range(m)]
        pooled = mi.rubin([d.mean() for d in draws], [d.var(ddof=1) / n for d in draws], level=0.90)
        fmi[r] = pooled["fmi"]
        for k, e, s, ci in (("complete cases", cc.mean(), cc.std(ddof=1) / np.sqrt(len(cc)), None),
                            ("single imputation", single.mean(), single.std(ddof=1) / np.sqrt(n), None),
                            ("multiple imputation", pooled["est"], pooled["se"], pooled["ci"])):
            est[k][r], se[k][r] = e, s
            lo, hi = ci if ci is not None else (e - z * s, e + z * s)
            cover[k][r] = lo < mu < hi

    lab = labs.Lab()
    for k in names:
        lab.row(k, f"mean {est[k].mean():.3f} (truth {mu:.0f})   sd {est[k].std(ddof=1):.3f}   "
                   f"mean SE {se[k].mean():.3f}   90% CI covers {cover[k].mean():.1%}")
    lab.row("fraction of missing information (MI)", f"{fmi.mean():.2f}")
    lab.note = ("Complete cases are biased because the rows that remain have smaller x. Imputing from the regression "
                "removes the bias, but one imputation treated as data claims a standard error that is too small; "
                "Rubin's between-imputation variance puts the missing uncertainty back.")
    cc, single, multi = names
    assert est[cc].mean() < mu - 0.2 and cover[cc].mean() < 0.2, "complete cases are biased under MAR"
    assert abs(est[single].mean() - mu) < 0.02 and abs(est[multi].mean() - mu) < 0.02, "imputation removes the bias"
    assert se[single].mean() / est[single].std(ddof=1) < 0.85 and cover[single].mean() < 0.84, "one imputation is overconfident"
    assert abs(se[multi].mean() / est[multi].std(ddof=1) - 1) < 0.12 and abs(cover[multi].mean() - 0.90) < 0.04, "Rubin's rules cover"

    fig, ax = labs.figure(2, size=(11, 4.2))
    x = rng.standard_normal(n)
    y = mu + x + rng.standard_normal(n)
    miss = mi.mask("mar", n, rate, rng, driver=x)["miss"]
    ax[0].scatter(x[~miss], y[~miss], s=12, color=labs.BLUE, alpha=0.8, label="observed")
    ax[0].scatter(x[miss], y[miss], s=12, color=labs.RED, alpha=0.5, marker="x", label="hidden (missing at random given x)")
    ax[0].axhline(y[~miss].mean(), color=labs.BLUE, ls="--", lw=1.2, label="complete-case mean")
    ax[0].axhline(mu, color=labs.INK, ls="--", lw=1.2, label="true mean")
    ax[0].set(title="One sample: rows with large x are hidden more often", xlabel="x (always seen)", ylabel="y")
    ax[0].legend(loc="upper left")
    colors = (labs.RED, labs.ORANGE, labs.GREEN)
    for i, (k, color) in enumerate(zip(names, colors)):
        ax[1].bar(i, 100 * cover[k].mean(), color=color, width=0.6)
        ax[1].text(i, 100 * cover[k].mean() + 2, f"{cover[k].mean():.1%}", ha="center", fontsize=9)
    ax[1].axhline(90, color=labs.INK, ls="--", lw=1)
    ax[1].set_axisbelow(True)
    ax[1].set_xticks(range(3))
    ax[1].set_xticklabels(["complete cases", "one regression\nimputation, naive SE", "multiple imputation,\nRubin's rules"])
    ax[1].set(title="Coverage of 90% intervals for the mean (dashed: 90%)", ylabel="coverage over 500 samples (%)", ylim=(0, 105))
    lab.fig = fig
    return lab

Now change it

  1. Change the mask to kind 'mnar' with y itself as the driver. Which of the three methods still covers?
  2. Set m = 2, then m = 50. How do the interval's width and the fraction of missing information change?
  3. Replace kind='proper' by kind='stochastic' in the imputations (no draw of beta and sigma). What happens to coverage?

Problems, with solutions

Try each problem before opening its solution.

  1. Rubin's factorization. Show that under MAR with distinct parameters, the likelihood factors as \(P(R \mid Y_{\text{obs}}, \phi) f(Y_{\text{obs}} \mid \theta)\).

    Solution

    f(Y_obs, R | θ, φ) = ∫ f(Y_obs, Y_mis | θ) P(R | Y_obs, Y_mis, φ) dY_mis. Under MAR the second factor does not depend on Y_mis, so it leaves the integral: P(R | Y_obs, φ) ∫ f(Y_obs, Y_mis | θ) dY_mis = P(R | Y_obs, φ) f(Y_obs | θ). With θ and φ distinct, the first factor is constant in θ.

  2. Selection on x. Bivariate normal, \(y\) missing when \(x > c\): show the complete-case slope of \(y\) on \(x\) is unbiased, but the mean of \(y\) is not.

    Solution

    If R depends on x only, f(y | x, R = 1) = f(y | x)P(R = 1 | x)/P(R = 1 | x) = f(y | x). So E[y | x, R = 1] is the true regression, and least squares on complete cases is unbiased under the correctly specified conditional-mean model and adequate support. But E[y | R = 1] = E[E(y | x) | R = 1] averages the regression over the selected x's, which differ from the population's.

  3. Rubin's variance. Derive \(T = W + (1 + 1/m)B\) from the law of total variance, including the \(B/m\) term.

    Solution

    Var(Q | Y_obs) = E[Var(Q | Y) | Y_obs] + Var[E(Q | Y) | Y_obs]. Estimate the first by W and the second by B. Averaging m draws adds simulation variance B/m to the mean, giving T = W + B + B/m.

  4. IPW and AIPW. Show \(E[R Y / \pi(X)] = E[Y]\) under MAR, and distinguish population unbiasedness with fixed nuisance functions from fitted-estimator consistency.

    Solution

    E[RY/π(X)] = E[E(R | X, Y) Y/π(X)] = E[π(X)Y/π(X)] = E[Y] under MAR.

    • AIPW: E[m(X) + R(Y − m(X))/π(X)].
    • If π is right, the second term has expectation E[Y − m(X)], so the total is E[Y].
    • If m is right, E[Y − m(X) | X, R = 1] = 0, so the second term vanishes and E[m(X)] = E[Y].
  5. Dilution. Show the OLS slope on \(W = X + U\) tends to \(\lambda\beta\), \(\lambda = \sigma_X^2 / (\sigma_X^2 + \sigma_U^2)\).

    Solution

    Cov(W, Y) = Cov(X + U, α + βX + ε) = βσ²_X and Var W = σ²_X + σ²_U. So the OLS slope tends to βσ²_X/(σ²_X + σ²_U) = λβ.

  6. The matrix method. With Se + Sp \(> 1\), show the matrix method recovers the true exposure share exactly in expectation.

    Solution

    E[share reporting exposure] = Se p + (1 − Sp)(1 − p) = (Se + Sp − 1)p + (1 − Sp), which is linear in p. So p = (E[share] − (1 − Sp))/(Se + Sp − 1), as an inversion of expected proportions when Se + Sp > 1. Nonlinear sample odds-ratio corrections are not thereby exactly unbiased; incompatible rates may require a constrained model.

Notes and sources

Where it comes back

  • Part 42: the comprehensive exam's consulting case starts with missing values.
  • Part 45: EM's convergence and the information lost to missingness.
  • Part 49: AIPW's semiparametric efficiency.
  • Part 62: unmeasured confounding with proxies.
  • Part 63: privacy noise as deliberate measurement error.

Glossary

  • MCAR; MAR; MNAR; ignorability: missingness unrelated to anything; explained by observed values; dependent on unseen values; MAR with distinct parameters.
  • Monotone pattern; unit and item nonresponse: dropouts who never return; whole-person and single-question gaps.
  • Complete-case analysis; available-case analysis; missing-indicator method; LOCF: the shortcuts.
  • EM; FIML; missing information: likelihood methods under MAR; the information the holes cost.
  • Multiple imputation; proper imputation; PMM; chained equations; Rubin's rules; FMI; congeniality: the MI toolkit.
  • IPW; AIPW; double robustness; calibration weighting: weighting approaches.
  • Selection model; inverse Mills ratio; exclusion restriction; pattern mixture; delta adjustment; tipping point; Manski bounds: MNAR approaches.
  • MRP; poststratification; small-area estimation: modelling self-selected samples.
  • Reliability; regression dilution; regression calibration; SIMEX; Berkson error; Deming regression: measurement error.
  • Sensitivity; specificity; nondifferential and differential misclassification; recall bias; validation study: misclassification.

Sources

  • Foundations.
    • A. Wald, A Method of Estimating Plane Vulnerability Based on Damage of Survivors (1943; reprinted 1980); M. Mangel & F. Samaniego, JASA 79 (1984).
    • D. Rubin, Biometrika 63 (1976); R. Little & D. Rubin (3rd ed. 2019); R. Little, JASA 83 (1988).
    • G. Molenberghs et al., JRSS B 70 (2008); K. Mohan & J. Pearl, JASA 116 (2021).
  • Simple methods.
    • S. Greenland & W. Finkle, Am. J. Epidemiol. 142 (1995).
    • National Research Council, The Prevention and Treatment of Missing Data in Clinical Trials (2010).
  • Likelihood.
    • S. F. Buck, JRSS B 22 (1960); A. Dempster, N. Laird & D. Rubin, JRSS B 39 (1977).
    • T. Louis, JRSS B 44 (1982); X.-L. Meng & D. Rubin, JASA 86 (1991).
  • Multiple imputation.
    • D. Rubin (1987); J. Barnard & D. Rubin, Biometrika 86 (1999); X.-L. Meng, Stat. Sci. 9 (1994).
    • S. van Buuren (2nd ed. 2018); S. van Buuren & K. Groothuis-Oudshoorn, J. Stat. Softw. 45 (2011).
    • I. White, P. Royston & A. Wood, Stat. Med. 30 (2011); P. von Hippel, Sociol. Methodol. 39 (2009), Sociol. Methods Res. 49 (2020).
  • Weighting.
    • J. Robins, A. Rotnitzky & L. P. Zhao, JASA 89 (1994); J.-C. Deville & C.-E. Särndal, JASA 87 (1992).
  • MNAR.
    • J. Heckman, Econometrica 47 (1979); T. Mroz, Econometrica 55 (1987).
    • R. Little, JASA 88 (1993); C. Manski, J. Hum. Resour. 24 (1989); ICH E9(R1) (2019).
  • MRP.
    • A. Gelman & T. Little, Survey Methodol. 23 (1997); W. Wang, D. Rothschild, S. Goel & A. Gelman, IJF 31 (2015).
  • Measurement error.
    • C. Spearman, Am. J. Psychol. 15 (1904); J. Cook & L. Stefanski, JASA 89 (1994).
    • R. Carroll, D. Ruppert, L. Stefanski & C. Crainiceanu (2006); W. E. Deming (1943); O. Reiersøl, Econometrica 18 (1950).
    • R. Barron, Biometrics 33 (1977); T. Lash, M. Fox & A. Fink, Applying Quantitative Bias Analysis (2009).
About this partfrom its README

Part 41 of a sixty-five-part course in statistics, from a first course to a PhD (see the series plan and the syllabus), and the twenty-first part of Stage III, Master's. Data go missing, and data are measured wrongly. This part asks when that matters and what can be done:

  • Rubin's mechanisms (MCAR, MAR, MNAR) and ignorability;
  • the easy methods' sins: complete cases, mean imputation, LOCF, the missing indicator, available cases;
  • likelihood under MAR: EM and FIML;
  • multiple imputation and Rubin's rules, chained equations, congeniality;
  • weighting as causal inference: IPW, AIPW, calibration;
  • data missing not at random: Heckman's selection model, pattern mixtures, tipping points, Manski's bounds;
  • MRP for self-selected samples;
  • measurement error and misclassification: attenuation, regression calibration, SIMEX, the matrix method.

The part builds statkit.mi and an instrument, the mask grid (MaskGrid): a data table as cells, with missing cells darkened by mechanism, imputed cells painted, and offset copies for the m completed data sets. Its real data are:

  • New York's air quality, May–September 1973 (ozone missing on 37 of 153 days);
  • NHANES 2017–2018's two 24-hour dietary recalls (public domain);
  • Mroz's (1987) 753 married women from the 1975 PSID (R's sampleSelection, GPL ≥ 2).

It opens with Wald's bombers (1943) in a stylized World of 2,000 planes, 1,252 of which return. The engines are 15% of the surface but carry 10.5% of the survivors' hits: the relative area-normalized hit-share deficit is about 30%. This is not the 40% per-hit engine kill probability in the toy generator (Mangel & Samaniego 1984).

From there the part covers:

  • Mechanisms.
    • Rubin (1976); MCAR, MAR, MNAR; the factorization and ignorability; missingness graphs (Mohan & Pearl 2021).
    • The World's survey of 2,000 with income withheld by 30% under three known masks. Under MAR the missing are 39.3 years old on average against 51.2 for the observed; under MNAR their hidden log incomes average 11.10 against 10.36.
    • Monotone and arbitrary patterns; dropout in trials. MCAR is testable (Little 1988); MAR against MNAR is not (Molenberghs et al. 2008).
  • The easy methods' sins.
    • Complete cases: on the true mean log income of 10.583, MCAR gives 10.585, MAR 10.609 and MNAR 10.358. A correctly specified conditional regression remains valid under selection on x alone, with adequate support; misspecified regression projections can change under selection.
    • The missing-indicator method (Greenland & Finkle 1995); available cases.
    • Mean imputation cuts the SD from 0.653 to 0.544. Regression imputation inflates the correlation with age from 0.103 to 0.127; appropriate stochastic draws restore residual variation in distribution, rather than reproducing both statistics exactly in one draw.
    • LOCF in a seeded trial: the true effect is −4.84, LOCF gives −4.47, MAR imputation −4.96.
  • Likelihood under MAR.
    • EM for the normal (Dempster, Laird & Rubin 1977); Buck (1960); why EM climbs; the missing information principle and Louis's SEs; FIML.
    • New York's ozone: EM converges in 12 iterations. The mean is 41.9 against 42.1 from complete cases, under a working multivariate-normal MAR model. Missing days have similar average temperature, which does not establish the full missingness mechanism.
  • Multiple imputation.
    • Rubin's rules derived; proper draws and PMM; chained equations (van Buuren); how many imputations; derived variables; congeniality (Meng 1994).
    • New York's log ozone on sun, wind and temperature: MI with m = 20 agrees with complete cases. The temperature coefficient is 0.049 (SE 0.006, FMI 0.33); √B ≈ two thirds of √W.
  • Weighting.
    • IPW = Horvitz–Thompson with a response propensity; the missing-data / causal dictionary; AIPW (Robins, Rotnitzky & Zhao 1994); calibration (Deville & Särndal 1992).
    • On the MAR mask: IPW 10.589 with the right model and 10.607 with the wrong one. AIPW is 10.589 with a correct response specification and a rich working outcome model and 10.607 when both are wrong.
    • Weights up to 3.3; 1,372 respondents are worth 1,279; balance on age is restored (47.5 against 47.5).
  • MNAR.
    • Heckman (1979) and the inverse Mills ratio.
    • Mroz: 428 of 753 worked; 62% of women with no child under 6 worked, against 39% with one and 27% with two. The return to a year of education is 0.1075 by OLS, 0.1091 by Heckman's two steps and 0.1084 by ML, with ρ̂ near 0: the residual correlation is near zero within this restrictive joint-normal specification, not proof that selection is absent.
    • Exclusion restrictions; Manski's bounds; pattern mixtures (Little 1993).
    • A sensitivity analysis on the MNAR mask reaches the truth near δ ≈ 0.7 (refusers about twice as rich). ICH E9(R1).
  • MRP.
    • The Xbox poll (Wang et al. 2015); Gelman & Little (1997).
    • The World's election, with Blue at 38.2%, and an opt-in poll of 3,000 that is 40% under-30 (against 22%) and 65% male. Raw 42.3%; raked 39.4%; MRP 38.9% (approximate conditional 90% interval 37.0–41.0).
    • By region: raw RMSE 3.2 points, MRP 2.6 (small regions are pooled toward the island).
    • YouGov 2017; small-area cousins; limits.
  • Measurement error.
    • Spearman (1904); regression dilution; the classical picture.
    • NHANES: two days' sodium correlate 0.34. SBP on one day's sodium gives 0.18 mm Hg/g (SE 0.15), on the two-day mean 0.35, and by regression calibration 0.77 (λ̂ = 0.24).
    • SIMEX (Cook & Stefanski 1994). Seeded (truth 2, reliability 0.39): naive 0.84, SIMEX 1.33, RC 2.15.
    • Replicates as instruments; Deming regression; Berkson error; residual confounding.
  • Misclassification.
    • The matrix method; a seeded case-control study with true OR 2.29 in the sample. Nondifferential recall (Se 0.8, Sp 0.9) gives 1.67, corrected to 2.07. Differential recall gives 2.53.
    • Outcome misclassification; validation substudies; probabilistic bias analysis.

Data:

  • the air quality, NHANES and Mroz's women are the Museum's;
  • the survey sample with its masks, the election and the opt-in polls are the World's;
  • the rest are seeded simulations.

Built in this part:

  • statkit.mi (explainer/stats/kit/mi.py), tested in tests/test_stats_kit_mi.py:
    • Masks and EM: MCAR, MAR and MNAR masks with known probabilities; EM for a multivariate normal with the observed log-likelihood.
    • Imputation: proper, stochastic, mean and PMM normal-regression imputation; proper logistic imputation; chained equations; Rubin's rules with Barnard–Rubin df and the FMI.
    • Weighting: response models; IPW and AIPW means.
    • MNAR: Heckman's two-step (with corrected SEs) and ML.
    • MRP: multilevel logistic regression with random effects by penalized IRLS and Laplace-chosen variances, with predictions and posterior draws.
    • Measurement error: Spearman's disattenuation; SIMEX; the misclassification matrix method.
  • The World gains its missing block: 2,000 adults, three income masks and an SBP mask, with their true probabilities.
  • The Museum gains mroz87.csv, read with museum._table.
  • The mask grid (MaskGrid in explainer/stats/viz.py).

The Coverage Board gains nine rows:

Method Setting Achieved Verdict
complete-case mean y MAR given x (40%), n = 300 0.4% broken
complete-case regression slope same: missingness depends on x only 89.4% kept
single regression imputation, naive SE same 70.8% broken
multiple imputation (m = 10), Rubin's rules same 89.3% kept
AIPW mean, influence-function SE same 86.5% broken (extreme weights)
opt-in poll, raw share the World's election, a self-selected sample of 1,500 2.5% broken
MRP, approximate conditional 90% posterior interval same 81.0% broken
OLS slope on an error-prone w reliability 0.61, n = 500 0.0% broken
regression calibration, bootstrap SE same, with a replicate; 199 resamples per dataset 88.9% kept

Scientific conditions and implementation scope:

  • Wald’s displayed hit-share deficit is normalized by total hits on returning planes. It illustrates survivorship selection, but is not itself an estimate of a hit’s kill probability. The toy model assumes independent Poisson strikes and location-dependent survival.
  • MAR ignorability needs distinct, variation-independent parameters and a suitable observed-data likelihood; Bayesian ignorability additionally needs the relevant prior factorization. MCAR has testable implications, but a non-significant diagnostic does not prove it. General missingness graphs require more than the simple arrow examples.
  • Conditional complete-case regression needs a correct conditional model and adequate covariate support. Marginal means and misspecified projections need not be preserved. The ten-column 60% example assumes independent holes. Missing-indicator trial adjustment requires appropriate baseline design, model and standard errors; pairwise covariance estimates can form an indefinite matrix even though individual pairwise correlations remain bounded.
  • EM accounts for missing conditional covariance under its fitted model; it does not guarantee a correct model, global optimum or universally correct spread. Its local convergence matrix involves a fraction of missing information; that ratio alone does not determine absolute interval width. Imputation counts and chained-equation mixing require diagnostics. The large-df relative variance share differs from finite-df FMI. Derived-variable imputations must preserve the substantive model’s needed interactions and nonlinear structure; a generic direct-term recipe need not preserve deterministic identities.
  • Known-probability Horvitz–Thompson means are unbiased under the stated MAR and positivity assumptions. Normalized or fitted-propensity estimators generally have finite-sample bias. AIPW double robustness concerns consistency; efficiency and standard-error claims require regularity and suitable nuisance estimation. The rich World outcome regression is a working approximation, not a known exact conditional mean. Trimming can introduce bias or change the target; Kish’s weight-only effective sample size is a diagnostic rather than a universal precision equivalence.
  • Heckman’s exclusions and joint-normal assumptions are identifying restrictions, not verified facts. Schooling coefficients are associations. The delta curve now reuses 20 completed datasets at every value, removing Monte Carlo noise between sensitivity settings. The oracle mean-matching shift is 0.6904 log-income units; it is not identified from observed data or a claim that every conditional distribution has that exact shift. A decision tipping point also needs a stated decision threshold.
  • Worked and repeated-poll MRP use the same factor structure, including age-by-sex effects, and the same group-SD grid (0.1, 0.3, 0.6). Intervals use a normal approximation at the posterior mode conditional on grid-selected group spreads. They omit hyperparameter uncertainty, and coarse cells leave residual selection. The study does not isolate the sources of undercoverage.
  • The NHANES analysis is an unweighted complete-case association among 2,805 adults not recorded as taking prescribed antihypertensives. Medication fields are unrecorded for 2,622 of them, including structural skips; this is not a verified all-off-medication cohort or a nationally representative causal sodium effect. Equal-variance, independent classical errors are assumptions behind interpreting repeat-day correlation as reliability. Regression calibration and replicate-instrument IV can share a population target while differing in finite samples.
  • Misclassification curves show odds ratios formed from expected cell proportions, not the exact expectation of a sample ratio. Toward-null population results need informative common error rates in the stated simple setting. The matrix example reports point corrections; an interval would additionally need sampling and error-rate uncertainty. Perfect specificity with common positive sensitivity preserves a population risk ratio, rather than making every sample ratio unbiased.
Chapter notes
# Chapter Numbers
0 Wald's bombers engines 15% of surface, 10.5% of hits
1 Mechanisms missing 39 vs observed 51 years old
2 The easy methods' sins SD 0.653 → 0.544; LOCF −4.47 vs −4.84
3 Likelihood under MAR EM in 12 iterations
4 Multiple imputation FMI 0.17–0.34; 70.8% vs 89.3%
5 Weighting is causal inference AIPW right if either model is
6 Missing not at random ρ̂ ≈ 0.03; tipping δ ≈ 0.7
7 MRP 42.3% → 38.9% (truth 38.2%)
8 Measurement error repeat-day correlation 0.34; conditional working λ = 0.24; RC 0.77
9 Misclassification OR 2.29 → 1.67 → 2.07
10 Outro —

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hook: Wald's bombers (1943) (Mangel & Samaniego 1984).
  2. Mechanisms (Rubin 1976). MCAR, MAR, MNAR; ignorability, derived; graphical views (Mohan & Pearl 2021).
  3. The easy methods' sins. Complete cases (Board); mean imputation; LOCF.
  4. Likelihood under MAR. EM for a normal with holes; FIML.
  5. Multiple imputation (Rubin 1987). Rubin's rules derived; chained equations; congeniality (Board).
  6. Weighting = causal inference. IPW and AIPW for missing outcomes.
  7. MNAR. Heckman (1979) and the inverse Mills ratio; pattern mixtures; tipping points.
  8. MRP (Gelman & Little 1997). The Xbox poll (Wang et al. 2015); MRP on the World (Board).
  9. Measurement error. Spearman (1904); regression calibration; SIMEX (Cook & Stefanski 1994).
  10. Misclassification.
  11. Outro. Upgrade card for Part 49.

Built: statkit.mi.

Build the film

python -m videos.stats.stats41.compute        # the part's numbers, into .cache/stats41
python tools/build.py stats41                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py stats41 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/stats/stats41. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it
OMP_NUM_THREADS=1 python -m videos.stats.stats41.compute   # once (a few minutes)
python tools/build.py stats41 -q l                         # fast 480p preview
python tools/build.py stats41                              # 1080p30 -> renders/stats41.mp4
python tools/qa_scene.py stats41 MultipleImputation
python tools/lecture_length.py stats41 --floor 50