Tutorials › Pattern-Mixture and Selection Models › Artificial-Masking Calibration for Outcome Predictions

Comparing Alternative MNAR Models · Tutorial 185 of 499

Artificial-Masking Calibration for Outcome Predictions

Use artificial masking to evaluate outcome predictions under dropout-like patterns, while distinguishing observable calibration performance from unsupported claims about naturally missing outcomes.

Advanced 12 min read

What You'll Learn

  • Define an artificial masking experiment for observed outcomes and dropout-like patterns.
  • Calculate prediction losses for outcomes hidden by an artificial mask.
  • Distinguish conditional calibration from marginal calibration across different covariate distributions.
  • Standardize calibration risks to a target covariate distribution when appropriate.
  • Identify leakage, limited support, and other reasons an artificial-masking result may mislead.
  • Explain why success on artificially masked outcomes does not validate MNAR extrapolation.

Why Artificially Mask Outcomes?

For a naturally missing outcome, its prediction cannot be checked against the true value in that case: the value is unavailable. Artificial-masking calibration offers a narrower check. It temporarily hides some outcomes that were observed, asks candidate models to predict them using the information that would have been available at the prediction time, and compares those predictions with the concealed values. The check can reveal predictive weaknesses under the artificial masking design. It does not, by itself, establish that predictions for naturally missing outcomes are accurate.

The distinction matters in dropout settings. A prediction for a patient's later outcome might be based on baseline covariates and earlier visits. To test that prediction, one can choose patients with observed later outcomes, conceal those outcomes in a dropout-like pattern, and compare predictions with the values that were concealed. The design of the concealment determines what this exercise can assess.

Definition: Let \(Y\) be an outcome, \(R=1\) indicate that it is naturally observed, and \(R=0\) that it is naturally missing. Let \(W\) denote variables available at the prediction time, such as baseline covariates and prior observed outcomes. Artificial masking selects some cases with \(R=1\), conceals their outcomes, and evaluates predictions made without access to those outcomes. A dropout-like artificial mask is a concealment design intended to resemble features of the natural dropout pattern, such as concealing a sequence of later visits after a selected time.

For a candidate model \(k\), write \(\hat F_k(\,\cdot\mid W)\) for its predictive distribution and \(\hat\mu_k(W)\) for its predicted conditional mean when that is the target. A loss function \(\ell\) measures the discrepancy between the true outcome and prediction. For example, squared-error loss for a mean prediction is \(\ell(Y,\hat\mu_k)=(Y-\hat\mu_k)^2\); absolute-error loss is \(|Y-\hat\mu_k|\). A probabilistic prediction can instead be evaluated with a proper scoring rule, such as the log score, provided the predictive distribution assigns a meaningful density or probability to the observed outcome.

The artificial-masking risk is the average loss among the outcomes concealed by the artificial design. It is a risk for that particular group, prediction procedure, loss, and masking design—not a universal measure of model quality. The model must not use the concealed value, or information derived from it, to fit the prediction being evaluated.

Designing a Meaningful Artificial Mask

A defensible exercise begins by specifying the prediction time and the information available then. In longitudinal data, if the target prediction is the next visit given baseline and earlier visits, the artificial mask must leave those predictors available and conceal the target visit. For a dropout-like assessment, it may conceal that visit and all later visits. Using a later outcome, a summary calculated from it, or a post-dropout variable to predict the concealed value would create information leakage and an artificially favorable result.

The artificial mask should also represent the pattern of interest as closely as possible. Relevant features might include the visit at which dropout begins, whether later outcomes are all unavailable, and the distribution of observed histories at that point. A mask based only on variables known before the concealed outcome can reproduce selected pattern features, but it cannot reproduce a dependence on the unseen outcome itself unless that dependence is somehow known from outside the observed data.

For a clean evaluation, predictions for artificially masked outcomes must be generated without fitting to those outcomes. One can reserve outcomes for evaluation or use a procedure that excludes each evaluated value from the fit used to predict it. The exact implementation depends on the data and candidate model; the essential condition is that the evaluated outcome is not allowed to influence its own prediction. When candidates use different MNAR assumptions, hold their shared observed-data components and prediction target as comparable as possible, while recognizing that their extrapolations can still differ.

Worked Example: Comparing Mean-Prediction Errors Under a Mask

Suppose a hypothetical clinic has four patients whose next-visit pain scores were observed. The scores range from 0 to 20 points. To mimic dropout before that visit, the analyst conceals each next-visit score and gives each candidate model only baseline information and the prior visit. Assume each prediction was produced without using the concealed score.

PatientConcealed score \(Y\) (points)Model A prediction (points)Model B prediction (points)
110119
2121114
38107
4151312

For Model A, the errors \(Y-\hat\mu_A\) are \(-1,1,-2,2\) points. Its mean absolute error is

$$ \operatorname{MAE}_A=\frac{|{-1}|+|1|+|{-2}|+|2|}{4} =\frac{6}{4}=1.50\text{ points}. $$

Its root mean squared error is

$$ \operatorname{RMSE}_A =\sqrt{\frac{(-1)^2+1^2+(-2)^2+2^2}{4}} =\sqrt{\frac{10}{4}} =1.581\text{ points}. $$

For Model B, the errors are \(1,-2,1,3\) points, so

$$ \operatorname{MAE}_B=\frac{1+2+1+3}{4} =1.75\text{ points},\qquad \operatorname{RMSE}_B=\sqrt{\frac{1+4+1+9}{4}} =\sqrt{3.75}=1.936\text{ points}. $$

On these four artificially concealed outcomes, Model A has the smaller average absolute and squared errors. This is a descriptive comparison under this mask, not evidence that Model A is better for all naturally missing outcomes. The check is especially limited if these four patients or their histories do not represent the cases with natural dropout.

What Calibration Risk Can Be Transported?

A central issue is whether the artificially masked cases represent the naturally missing cases. Let \(G=1\) denote membership in the artificial calibration group and \(G=0\) membership in the target group of naturally missing cases. For a fixed prediction rule and loss, define the conditional risks \(r_1(w)=E\{\ell(Y,\hat F(W))\mid W=w,G=1\}\) and \(r_0(w)=E\{\ell(Y,\hat F(W))\mid W=w,G=0\}\). These definitions separate outcome behavior at a fixed \(W\) from the distribution of \(W\) across groups.

If the conditional risks agree, \(r_1(w)=r_0(w)\), then calibration can inform target risk at that particular \(w\), provided the calibration group contains relevant cases there. But equality of conditional risks alone does not imply equal marginal risks. The two groups may have different distributions of \(W\), and risk may vary with \(W\).

Key result: If the target covariate distribution \(F_0\) is supported by the calibration covariate distribution \(F_1\), and conditional risks transport so that \(r_1(w)=r_0(w)\) on the target support, then the target marginal risk is $$ R_0=\int r_0(w)\,dF_0(w) =\int r_1(w)\,dF_0(w). $$ The unadjusted calibration risk is instead \(R_1=\int r_1(w)\,dF_1(w)\). These marginal risks agree if, for example, \(F_1=F_0\), or if risk is constant over the relevant values of \(W\). Otherwise, estimate conditional risks and average them over the target distribution, or reweight calibration cases to that distribution.

The justification follows by conditioning on \(W\): the marginal expected loss in either group is the average of its conditional expected loss over that group's distribution of \(W\). Under conditional transport, the conditional-risk functions are the same, but their averages can differ when the averaging distributions differ. If \(F_0\) has a density relative to \(F_1\), a reweighted calibration average uses weights proportional to \(dF_0/dF_1\). In finite strata, this amounts to averaging each stratum's estimated conditional risk using the target stratum proportions. This requires adequate support: a target stratum with no calibration cases cannot be repaired by weighting.

Worked Example: Why Matching Conditional Risks Is Not Enough

Suppose \(W\) is binary and the loss is 0 when \(W=0\) and 10 when \(W=1\), both among artificially masked cases and among naturally missing cases. Thus, conditional risks match exactly at both values of \(W\), and both groups have support at both values. Suppose the calibration group has \(P(W=1\mid G=1)=0.1\), while the target group has \(P(W=1\mid G=0)=0.5\).

The unadjusted calibration risk is

$$ R_1=0(0.9)+10(0.1)=1. $$

The target risk is

$$ R_0=0(0.5)+10(0.5)=5. $$

To standardize the calibration conditional risks to the target distribution, use the target weights: \(R_0=0(0.5)+10(0.5)=5\). Thus, matching conditional risks is useful, but the unadjusted calibration average of 1 is not the target marginal risk of 5. The discrepancy comes entirely from the different distributions of \(W\), not from a difference in conditional risk.

Why This Does Not Validate MNAR Extrapolation

Artificial masking starts with outcomes that are naturally observed. Even if the artificial pattern resembles dropout, the cases available for masking have already passed through the natural observation process. When natural observation depends on the unseen outcome after conditioning on available information, the observed outcomes need not represent outcomes among naturally missing cases. Artificially hiding observed values cannot reveal the values that natural dropout concealed.

A useful way to state the limitation is that a calibration result supports transport only under assumptions about conditional outcome behavior, the prediction rule, and the covariate distribution. Under MNAR, the conditional distribution of the outcome among naturally missing cases can differ from that among naturally observed cases even at the same recorded history. Artificial masking may show that a candidate predicts well for selected observed cases under a chosen pattern; it does not identify the unobserved conditional distribution or prove the MNAR assumptions correct.

Worked Example: A Good Artificial Check Can Miss MNAR Selection

Consider a hypothetical binary outcome \(Y\), where 1 indicates a high symptom score and 0 a lower score. Suppose \(P(Y=1)=0.5\), and natural observation depends on \(Y\): \(P(R=1\mid Y=1)=0.8\) and \(P(R=1\mid Y=0)=0.4\). There are no additional covariates in this example.

Among naturally observed cases, the high-outcome proportion is

$$ P(Y=1\mid R=1) =\frac{0.8(0.5)}{0.8(0.5)+0.4(0.5)} =\frac{0.4}{0.6} =0.667. $$

Among naturally missing cases, it is

$$ P(Y=1\mid R=0) =\frac{0.2(0.5)}{0.2(0.5)+0.6(0.5)} =\frac{0.1}{0.4} =0.250. $$

Suppose a candidate predicts a high-outcome probability of 0.6 for everyone, and use Brier loss \((Y-0.6)^2\). Artificial masking among naturally observed cases has expected loss

$$ 0.667(1-0.6)^2+0.333(0-0.6)^2 =0.667(0.16)+0.333(0.36) =0.227\text{ (approximately)}. $$

For the naturally missing cases, the corresponding risk is

$$ 0.250(0.16)+0.750(0.36)=0.310. $$

The artificial check evaluates performance in the observed group; its favorable-looking risk does not establish the target risk for naturally missing cases. Here the outcome itself drives observation, so the difference remains even though there is no \(W\) distribution to adjust. The example is not a way to estimate the missing-outcome risk from ordinary observed data; it demonstrates why that risk is not validated by artificial masking.

Diagnostics, Comparisons, and Limitations

Before interpreting a calibration result, check whether the masking experiment actually targets the intended prediction problem. Compare the artificial and natural patterns using variables known before dropout, including histories and the timing and extent of missingness. Check whether target cases have counterparts in the calibration data. If some histories or subgroups are absent, conditional transport for those regions cannot be assessed empirically. Very large reweighting factors, if used, signal that the target distribution is poorly represented and can make a weighted estimate unstable.

Also inspect the prediction process for leakage, and report the loss and its units or interpretation. Mean squared error emphasizes large errors and has squared outcome units; RMSE returns to the outcome's units. A proper score for predictive distributions assesses more than the predicted mean, but its value depends on the selected scoring rule. A small average loss can hide poor predictions in a subgroup or at a particular visit, so summaries by relevant histories and dropout patterns can be informative when sample sizes allow.

Artificial-masking calibration complements, rather than replaces, other checks. Observed-data residual checks assess discrepancies in outcomes that were actually observed. Posterior predictive checks assess whether model-generated data reproduce selected features of observed data under the fitted model. Artificial masking directly tests predictions against known values withheld from the prediction process, but only for the artificially selected cases. Sensitivity analysis across MNAR specifications addresses how conclusions change under alternative assumptions about unseen outcomes; artificial masking cannot select among those assumptions solely by revealing how well they predict outcomes from the observed group.

The main limitations are selection into the observed calibration sample, imperfect resemblance between artificial and natural dropout, limited support, and dependence of results on the chosen loss. Calibration also evaluates a prediction procedure fitted under the artificial exercise; that procedure may not be identical to the final analysis fit. Consequently, report the masking design and target clearly, and describe the result as evidence about prediction performance under that design—not as verification of the naturally missing outcomes.

Common pitfall: “The candidate predicted artificially masked observed outcomes well, so its predictions for naturally missing outcomes are validated.” This conclusion does not follow. The correction is to state the calibration population and mask, assess support and covariate-distribution differences, standardize conditional risks to the target distribution when justified, and acknowledge that MNAR outcome dependence is not identified by masking observed outcomes.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. What must be kept out of a prediction fit when evaluating an artificially masked outcome?
  2. Calibration and target conditional risks match at each value of \(W\). What additional issue determines whether their marginal risks match?
  3. Calibration risks are 2 and 8 in two strata. The target has stratum proportions 0.25 and 0.75. What is the standardized target risk?
  4. Why can a dropout-like artificial mask fail to validate predictions for naturally missing outcomes under MNAR?

Solutions. (1) The concealed outcome and any information derived from it must be excluded from the fit and prediction. (2) The distributions of \(W\) must also match for unadjusted marginal risks to match; otherwise, standardize the conditional risks to the target distribution, assuming adequate support and transport. (3) The standardized risk is \(2(0.25)+8(0.75)=0.5+6=6.50\) loss units. (4) Under MNAR, natural observation can depend on the unseen outcome, so observed cases used for artificial masking may have a different outcome distribution from naturally missing cases even at the same recorded history. Mimicking the visible dropout pattern does not reveal that hidden dependence.

Clinical Biostats