# Survey Analysis: Weighted Randomization to fill Missing Values

I am developing a Survey Analysis Application that works with Categorical Data and looking for a way to treat missing data fairly without losing the original data variance.

Thus, I came up with a way to deal with these values, that is, for every missing value, we make a list of non-missing values in the same column, randomly select a value from that list by using np.random.choice, and use it to fill in the missing value. The randomization by itself is weighted. If a value has a greater frequency, it would have a higher chance of being filled.

The problem is, I have not seen anyone done it this way before so I am not sure whether it would maintain the data variance and the fairness of the survey. Any feedback, suggestions, or flaws that you find in this approach would be greatly appreciated.

• Taking into account not only the relative frequencies of categories, but also the relationships with other variables. One way to do this is with multiple imputation by chained equations (MICE). In R, the package mice can do this,$$^{[1]}$$ perhaps there is an implementation in Python as well.
$$[1]$$: Buuren, Stef. Flexible imputation of missing data. Boca Raton, FL: CRC Press, 2018. Print.