Press "Enter" to skip to content

Writing MICE from Scratch in R

Ken Koon Wong rewrites a package:

We used mulitple imputation by chained equations (MICE) quite often in imputing missing data in many occasion, but I never really understood the mechanism behind it except that it appears magical! 🧙 I want to see if I can build this from scratch as a mean to understand the foundation of MICE so that at least it will give me the illusion of understanding. 🤣 Join me in my messy journey of trying to code it from the ground up (FYI, I’m not coding OLS or MLE from the ground up…), and let’s see if we can create some “magic” here! This is going to be a bumpy one with lots of coding, and maybe less of mathematical formulae. I’ll try my best to provide a TL;DR for each section so that we can get a high level view as well. Buckle up! And oh, Happy Halloween! 🎃 What a better time to look at magical recipes of statistics! Let’s go!

I really like this post. The end result isn’t exactly what the mice implementation gives, but it’s close enough to show real understanding of the algorithm. H/T R-Bloggers.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.