# Missing data - Regression imputation

I want to produce imputations for the missing values using a naive imputation method "Regression imputation " . The first step involves building a model from the observed data then predictions for the incomplete cases are calculated under the fitted model, and serve as replacements for the missing data .

Suppose that we model Ozone by the linear regression function of Solar.R

> library(mice)
> fit <- lm(Ozone ~ Solar.R, data = airquality)
> pred <- predict(fit, newdata = ic(airquality))
# Or alternatively using mice package
> imp <- mice(airquality[,1:2], method="norm.predict", m=1, maxit=3,seed=1)


I did not get how the fifth observation is imputed under the fitted model ? , since both Ozone and Solar.R are missing !.

• Yes, that"s true , but I didn't get how R imputed the observations in which both Ozon and Solar.R are missing !, since the model includes just one predictor Solar.R. Did u check the code (the 5th obs.) ? or this one sum(as.numeric(!is.na(complete(imp)))) ; dim(airquality[,c(1,2)]) – Bahgat Nassour Nov 14 '16 at 17:14