A study expects a quarter of its outcomes to be missing. Is the planned precision still within reach? The overall missingness rate cannot answer this on its own. Under missing at random (MAR), the efficient variance depends on which units go missing: losing outcomes where the residual variance is small costs little, and losing them where it is large costs a great deal. Rules of thumb that tolerate a fixed percentage of missing data treat every mechanism with that rate alike.
The package implements the precision envelope of Nakamura (2026), which replaces the rule of thumb with a calculation. For a stated overall observation rate \(p\) and a lower bound \(\pi_L\) on the observation probability, it returns the sharp range of efficient variance that the admissible MAR mechanisms can produce. Against a precision requirement, each rate is then guaranteed (every admissible mechanism meets the requirement), allocation-sensitive (some mechanisms meet it and others do not) or inadmissible (no admissible mechanism meets it).
At the design stage the inputs are the share \(R^2\) of the outcome variance explained by the always observed covariates, the lower bound \(\pi_L\), and a law for the residual variance \(b(W) = \mathrm{Var}(Y \mid W)\). With a constant residual variance, MCAR is the favorable mechanism, and the envelope reduces to the interval between MCAR and the adverse mechanism.
env <- precision_envelope(p = c(0.95, 0.85, 0.75, 0.65), lower = 0.10,
r2 = 0.30, target = 0.80)
env
#> Sharp precision envelope
#> Overlap lower bound: 0.100 (missingness rates up to 0.900 are admissible)
#> Variance components: A = 0.4286 B = 1 R2 = 0.300
#> Covariate space: continuous
#> Requirement: information retention of at least 0.800
#>
#> Information retention by overall missingness rate q:
#> q favorable MCAR adverse SE increase phase
#> 0.050 0.964 0.964 0.741 1.8% to 16.2% allocation-sensitive
#> 0.150 0.890 0.890 0.488 6.0% to 43.2% allocation-sensitive
#> 0.250 0.811 0.811 0.364 11.1% to 65.8% allocation-sensitive
#> 0.350 0.726 0.726 0.290 17.3% to 85.7% inadmissible
#>
#> Threshold missingness rates for the requirement:
#> guaranteed up to q = 0.036
#> met under MCAR up to q = 0.263
#> attainable by some admissible mechanism up to q = 0.263When the residual variance differs across covariate profiles, the favorable mechanism can do better than MCAR, because it concentrates the missing outcomes where they carry little information. A gamma law with a stated coefficient of variation is a convenient planning assumption; fitted values from a pilot study can be used instead.
het <- precision_envelope(p = c(0.95, 0.85, 0.75, 0.65), lower = 0.10,
r2 = 0.30, b = residual_law_gamma(cv = 0.8),
target = 0.80)
het
#> Sharp precision envelope
#> Overlap lower bound: 0.100 (missingness rates up to 0.900 are admissible)
#> Variance components: A = 0.4286 B = 1 R2 = 0.300
#> Covariate space: continuous
#> Requirement: information retention of at least 0.800
#>
#> Information retention by overall missingness rate q:
#> q favorable MCAR adverse SE increase phase
#> 0.050 0.993 0.964 0.472 0.3% to 45.6% allocation-sensitive
#> 0.150 0.956 0.890 0.283 2.3% to 87.9% allocation-sensitive
#> 0.250 0.895 0.811 0.219 5.7% to 113.5% allocation-sensitive
#> 0.350 0.815 0.726 0.187 10.8% to 131.4% allocation-sensitive
#>
#> Threshold missingness rates for the requirement:
#> guaranteed up to q = 0.008
#> met under MCAR up to q = 0.263
#> attainable by some admissible mechanism up to q = 0.367
plot(het)The shaded region is the set of retentions that some admissible mechanism attains. The vertical lines mark the threshold missingness rates: below \(q_G^*\) the requirement holds whatever the mechanism, and beyond \(q_P^*\) it fails whatever the mechanism.
Section 5.1 of Nakamura (2026) uses a residual variance that takes the values 0.1 and 1.9 on two regions of equal mass, with \(A = B = 1\), \(\pi_L = 0.2\) and a requirement of 80% retention. At 75% observation the favorable allocation raises the standard error by 1.2% and MCAR by 8.0%.
ill <- precision_envelope(p = 0.75, lower = 0.2, A = 1, b = c(0.1, 1.9),
target = 0.80)
ill$table[, c("q", "se_inflation_favorable", "se_inflation_mcar",
"se_inflation_adverse", "phase")]
#> q se_inflation_favorable se_inflation_mcar se_inflation_adverse
#> 1 0.25 0.01242284 0.08012345 0.4790199
#> phase
#> 1 allocation-sensitive
ill$thresholds
#> guaranteed mcar possible
#> 0.05263158 0.33333333 0.52000000The thresholds are \(q_G^* = 5.3\%\), \(q_{MCAR}^* = 33.3\%\) and \(q_P^* = 52.0\%\). When the mechanism may separate units within a region, the adverse endpoint at 25% missing raises the standard error by 47.9%. When the observation probability can depend only on the region label, each region is an indivisible stratum. The adverse endpoint is then the allocation that observes the high-variance region half the time, which raises the standard error by 21.4%, and \(q_G^*\) rises to 17.2%.
strata <- precision_envelope(p = 0.75, lower = 0.2, A = 1, b = c(0.1, 1.9),
covariate = "strata", target = 0.80)
strata$table[, c("q", "rho_adverse", "se_inflation_adverse")]
#> q rho_adverse se_inflation_adverse
#> 1 0.25 0.6779661 0.2144958
strata$thresholds
#> guaranteed mcar possible
#> 0.1724138 0.3333333 0.5200000Starting from that allocation, in which the high-variance half is observed only half the time, the cheapest way to restore 80% retention is to recover part of the missing outcomes in that half, following the cost-adjusted square-root rule. With equal costs, recovering 7.76 outcomes per 100 participants raises the observation rate to 82.76%.
plan <- recovery_plan(b = c(0.1, 1.9), baseline = c(1, 0.5), A = 1,
target = 0.80)
plan
#> Minimum-cost targeted recovery plan
#> Status: planned
#> Residual variance component: baseline 1.95 , required 1.5 , complete data 1
#> Observation rate: 0.750 -> 0.828
#> Share of currently missing outcomes to recover: 0.310
#> Expected added cost per unit: 0.07759envelope_fit() estimates the envelope for the mean of a
partially observed continuous outcome. The example uses the MASLD cases
of the public survival::nafld1 data, with baseline body
mass index as the outcome and age and sex as covariates.
nafld1 <- survival::nafld1
cases <- nafld1[!is.na(nafld1$case.id) & nafld1$id == nafld1$case.id, ]
dat <- data.frame(bmi = as.numeric(cases$bmi), age = as.numeric(cases$age),
male = as.integer(cases$male == 1))
dat$age_centered_sq <- (dat$age - mean(dat$age))^2
set.seed(20260901)
fit <- envelope_fit(dat, outcome = "bmi",
covariates = c("age", "male", "age_centered_sq"),
p = c(0.70, 0.75, 0.80, 0.85, 0.90, 0.97),
lower = 0.05, target = 0.80)
fit
#> Estimated precision envelope for the mean of bmi
#> n = 3545 observed = 3015 observation rate = 0.850
#> Overlap lower bound: 0.050
#> Estimated mean: 34.2152
#> Variance components: A = 2.514 B = 55.24 C (realized) = 64.74
#> Realized information retention: 0.859 (95% Wald interval 0.847 to 0.871 )
#> Requirement: information retention of at least 0.800
#>
#> Estimated envelope (point estimates):
#> p q favorable adverse phase
#> 0.700 0.300 0.722 0.105 inadmissible
#> 0.750 0.250 0.772 0.121 inadmissible
#> 0.800 0.200 0.821 0.141 allocation-sensitive
#> 0.850 0.150 0.869 0.176 allocation-sensitive
#> 0.900 0.100 0.914 0.242 allocation-sensitive
#> 0.970 0.030 0.974 0.529 allocation-sensitive
#>
#> Use envelope_bootstrap() for a simultaneous band and certified phases.
plot(fit)The realized mechanism retained about 86% of the information, close to the favorable endpoint at the same observation rate. At the same 15% missingness, the adverse endpoint in the table shows how much less an admissible mechanism could have retained.
The point classification ignores sampling error.
envelope_bootstrap() refits every nuisance model on
resampled units and certifies a phase only when a simultaneous band
excludes the others. In practice use R = 999; 199 refits
keep this vignette fast.
set.seed(20260901)
band <- envelope_bootstrap(fit, R = 199)
band
#> Simultaneous refitted-bootstrap band for the precision envelope
#> Successful refits: 199 of 199 (failure policy: abort )
#> Critical value: 3.273 (rank 190 , level 0.95 )
#>
#> Certified phase by overall missingness rate:
#> q phase
#> 0.300 inadmissible
#> 0.250 inadmissible
#> 0.200 allocation-sensitive
#> 0.150 allocation-sensitive
#> 0.100 allocation-sensitive
#> 0.030 allocation-sensitive
#>
#> Confidence intervals for the threshold missingness rates:
#> qG in [0.000, 0.030]
#> qP in [0.200, 0.250]The package does not impute missing values, does not improve the estimate of the target, and does not test MAR. The lower bound \(\pi_L\) is an assumption stated by the analyst; the fitted share of observation probabilities below it is reported only as a diagnostic.
Nakamura S (2026). Sharp estimand-specific precision envelopes for blockwise missing data under missing at random. Stats, 9(5), 110. https://doi.org/10.3390/stats9050110