I understand that Professor Harrell recommends using the target variable in Multiple Imputation. An example using aregImpute of the rms package is in his lecture notes: http://hbiostat.org/doc/rms.pdf p.12-20 to 12-22
In the note, the steps as I understood are as follows:
- use the whole training dataset (including target variable) to build a imputation model using aregImpute function of rms
- impute the training dataset, create a couple imputed copies
- use fit.mult.impute to build predictive models from the imputed datasets
My question is:
How should I then apply this model that was built on a new dataset with some missing data?
- stack them to the train dataset and do aregImpute for all variables, build a model using only the newly imputed train, and then apply on the imputed test? But then wouldn't I have imputed the target for the new dataset as well?
- stack them to the train dataset and do aregImpute for all variables but Target, build a model using only the newly imputed train, and then apply on the imputed test? If this is the way to go, wouldn't the imputed values be biased? Also, how could one do this in R?
It would be really nice if one could take the imputation process and the model fitted and just apply it on a new dataset (like how one could apply PCA or any model
) as this seems like such a common task for real-world predictive modeling...