overimpute: Overimputation: calibration diagnostic for an imputation...

View source: R/overimpute.R

overimputeR Documentation

Overimputation: calibration diagnostic for an imputation model

Description

Answers "is my imputation model well calibrated?" without ground truth (the analogue of Amelia::overimpute(), model-agnostic): the observed cells of one variable are treated as missing – fold by fold, so every observed cell is overimputed exactly once – and imputed with draws multiple imputations via vimpute(). For each cell the observed value is compared with the mean and a level interval of its draws; a well-calibrated model covers roughly level of the observed values. Any genuinely missing cells stay missing and are imputed as part of the model, exactly as they would be in a real run.

Usage

overimpute(data, variable, ..., draws = 5, folds = 5, level = 0.9, seed = NULL)

## S3 method for class 'vimpute_overimpute'
print(x, ...)

## S3 method for class 'vimpute_overimpute'
plot(x, ...)

Arguments

data

Dataset with (possibly) missing values.

variable

Single column name: the numeric variable whose observed cells are overimputed.

...

Passed on to vimpute() (e.g. method, spec, uncert, sequential). m is controlled via draws and cannot be supplied.

draws

Number of multiple-imputation draws per cell (>= 2).

folds

Number of folds the observed cells are split into (each fold is set missing and overimputed in one vimpute() run; capped at the number of observed cells).

level

Coverage level of the reported interval (default 0.9).

seed

Optional single number: applied via set.seed() before the fold split and the imputation runs.

x

A vimpute_overimpute object

Details

The ... arguments are passed on to vimpute(), so the diagnostic runs for any method, spec, or grammar configuration – e.g. overimpute(dat, "y", method = "robust") or overimpute(dat, "y", spec = list(y = vs_ranger(num.trees = 300))). Note the cost: folds x draws imputation runs; lower folds and draws (the defaults are modest) or use a fast method for large data. For a stochastic spread of the draws keep an uncertainty source switched on (the default uncert = "pmm", or boot/uncert); with purely deterministic settings all draws coincide and the intervals collapse.

Value

A data.frame of class vimpute_overimpute with one row per observed cell: row (row index in data), observed, mean, lower, upper (quantiles of the draws at level), and covered. Attributes: variable, level, draws, folds. print() reports the empirical coverage; plot() draws the observed-vs-imputed calibration plot with intervals and the 45-degree line.

Author(s)

Matthias Templ

See Also

vimpute(), makeMissing(), evaluation()

Examples

## Not run: 
data(sleep)
ov <- overimpute(sleep, "Sleep", method = "robust", sequential = FALSE,
                 draws = 5, folds = 5, seed = 1)
print(ov)   # empirical coverage of the 90% intervals
plot(ov)

## End(Not run)

VIM documentation built on Sept. 2, 2026, 5:07 p.m.