View source: R/helper_vimpute.R
| midastouch_donors | R Documentation |
For each missing value, finds k nearest donors using a combined score: closeness in predicted value (score) AND closeness in covariate space (Mahalanobis distance). Donors closer in covariate space are upweighted.
midastouch_donors(
y_obs,
X_obs,
X_miss,
score_obs = NULL,
score_miss = NULL,
k = 5L
)
y_obs |
Observed values of the target variable |
X_obs |
Predictor matrix for observed rows (n_obs x p) |
X_miss |
Predictor matrix for missing rows (n_miss x p) |
score_obs |
Model predictions for observed rows |
score_miss |
Model predictions for missing rows |
k |
Number of candidate donors (default 5) |
Based on Siddique & Belin (2008), "Multiple imputation using an iterative hot-deck with distance-based donor selection", Statistics in Medicine.
Numeric vector of length n_miss with imputed values drawn from donors
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.