I have a dataset that has missing values and I am just testing various methods that are used to replace them for my thesis. I would like to know how does the mean substitution method works, like say I have 3 missing values in my data. For the first missing values, it calculates the mean of the known values and insert that value for the first missing data. I would like to know if the method suppose to replace all the missing values with the mean of the known values or does it do it for each missing values, say it takes into account of insert value for the first missing values and calculate the new mean to replace the next missing value?
1 Answer
$\begingroup$
$\endgroup$
Your two ways are not different: they give the same result. You can use algebra to check that $$ \frac{x_1+\dotsm+x_n+\bar{x}}{n+1}=\bar{x} $$ where $\bar{x} = \frac{x_1+\dotsm+x_n}{n}$ is the mean.