I have to impute missing values in the column named <Age>
with the mean of the nearest available values above and below in the column <Age>
.
If the Age
column had values in order
NA,7,6,NA,7,8,NA,NA,NA,10,5,NA,NA,5,9,9,12,8,6,NA,NA
After imputation, column should look like
7,7,6,6.5,7,8,9,9,9,10,5,5,5,5,9,9,12,8,6,6,6
I know about filling value with mean, mode, or median forward filling, backward filling but not this one. I am new to this field and a student. Any help would be appreciated.
Thanks